Skip to content

Class SliceSettings

Definition

Namespace: StardewUI.Graphics
Assembly: StardewUI.dll

Additional nine-slice settings for dealing with certain "unique" structures.

[StardewUI.DuckType]
public record SliceSettings : IEquatable<StardewUI.Graphics.SliceSettings>

Inheritance
Object ⇦ SliceSettings

Implements
IEquatable<SliceSettings>

Members

Constructors

Name Description
SliceSettings(Int32?, SliceCenterPosition, Int32?, SliceCenterPosition, Single, Boolean) Additional nine-slice settings for dealing with certain "unique" structures.

Properties

Name Description
CenterX The X position to use for the horizontal center slices, or null to start where the left fixed edge ends.
CenterXPosition Specifies whether the CenterX should be understood as the start position or the end position of the horizontal center slice.
CenterY The Y position to use for the vertical center slices, or null to start where the top fixed edge ends.
CenterYPosition Specifies whether the CenterY should be understood as the start position or the end position of the vertical center slice.
EdgesOnly If true, then only the outer 8 edge segments should be drawn, and the 9th (horizontal and vertical middle, i.e. "background") segment will be ignored.
EqualityContract
Scale Scale to apply to the slices themselves; for example, if a 16x16 source draws to a 64x64 target, and a scale of 2 is used, then a 2x3 border slice would draw as 16x24 (normal 8x16, multiplied by 2).

Methods

Name Description
WithScale(Single) Creates a copy of this SliceSettings with a different scale.

Details

Constructors

SliceSettings(int?, SliceCenterPosition, int?, SliceCenterPosition, float, bool)

Additional nine-slice settings for dealing with certain "unique" structures.

public SliceSettings(int? CenterX, StardewUI.Graphics.SliceCenterPosition CenterXPosition, int? CenterY, StardewUI.Graphics.SliceCenterPosition CenterYPosition, float Scale, bool EdgesOnly);
Parameters

CenterX   Nullable<Int32>
The X position to use for the horizontal center slices, or null to start where the left fixed edge ends.

CenterXPosition   SliceCenterPosition
Specifies whether the CenterX should be understood as the start position or the end position of the horizontal center slice.

CenterY   Nullable<Int32>
The Y position to use for the vertical center slices, or null to start where the top fixed edge ends.

CenterYPosition   SliceCenterPosition
Specifies whether the CenterY should be understood as the start position or the end position of the vertical center slice.

Scale   Single
Scale to apply to the slices themselves; for example, if a 16x16 source draws to a 64x64 target, and a scale of 2 is used, then a 2x3 border slice would draw as 16x24 (normal 8x16, multiplied by 2).

EdgesOnly   Boolean
If true, then only the outer 8 edge segments should be drawn, and the 9th (horizontal and vertical middle, i.e. "background") segment will be ignored.


Properties

CenterX

The X position to use for the horizontal center slices, or null to start where the left fixed edge ends.

public int? CenterX { get; set; }
Property Value

Nullable<Int32>


CenterXPosition

Specifies whether the CenterX should be understood as the start position or the end position of the horizontal center slice.

public StardewUI.Graphics.SliceCenterPosition CenterXPosition { get; set; }
Property Value

SliceCenterPosition


CenterY

The Y position to use for the vertical center slices, or null to start where the top fixed edge ends.

public int? CenterY { get; set; }
Property Value

Nullable<Int32>


CenterYPosition

Specifies whether the CenterY should be understood as the start position or the end position of the vertical center slice.

public StardewUI.Graphics.SliceCenterPosition CenterYPosition { get; set; }
Property Value

SliceCenterPosition


EdgesOnly

If true, then only the outer 8 edge segments should be drawn, and the 9th (horizontal and vertical middle, i.e. "background") segment will be ignored.

public bool EdgesOnly { get; set; }
Property Value

Boolean


EqualityContract

protected System.Type EqualityContract { get; }
Property Value

Type


Scale

Scale to apply to the slices themselves; for example, if a 16x16 source draws to a 64x64 target, and a scale of 2 is used, then a 2x3 border slice would draw as 16x24 (normal 8x16, multiplied by 2).

public float Scale { get; set; }
Property Value

Single


Methods

WithScale(float)

Creates a copy of this SliceSettings with a different scale.

public StardewUI.Graphics.SliceSettings WithScale(float newScale);
Parameters

newScale   Single
The scale to use.

Returns

SliceSettings

A copy of this SliceSettings with its Scale set to newScale.