Skip to content

Class Sprite

Definition

Namespace: StardewUI.Graphics
Assembly: StardewUI.dll

Definition for a scalable sprite.

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

Inheritance
Object ⇦ Sprite

Implements
IEquatable<Sprite>

Members

Constructors

Name Description
Sprite(Texture2D, Rectangle?, Edges, SliceSettings) Definition for a scalable sprite.

Properties

Name Description
EqualityContract
FixedEdges The thickness of each "fixed" edge to use with 9-patch/9-slice scaling. Specifying these values can prevent corner distortion for images that have been designed for such scaling. See Nine-Slice Scaling for a detailed explanation.
Size The size (width/height) of the sprite, in pixels.
SliceSettings Additional settings for the scaling and slicing behavior.
SourceRect The inner area of the Texture in which the specific image is located, or null to draw the entire texture.
Texture The texture containing the sprite's pixel data.

Details

Constructors

Sprite(Texture2D, Rectangle?, Edges, SliceSettings)

Definition for a scalable sprite.

public Sprite(Microsoft.Xna.Framework.Graphics.Texture2D Texture, Microsoft.Xna.Framework.Rectangle? SourceRect, StardewUI.Layout.Edges FixedEdges, StardewUI.Graphics.SliceSettings SliceSettings);
Parameters

Texture   Texture2D
The texture containing the sprite's pixel data.

SourceRect   Nullable<Rectangle>
The inner area of the Texture in which the specific image is located, or null to draw the entire texture.

FixedEdges   Edges
The thickness of each "fixed" edge to use with 9-patch/9-slice scaling. Specifying these values can prevent corner distortion for images that have been designed for such scaling. See Nine-Slice Scaling for a detailed explanation.

SliceSettings   SliceSettings
Additional settings for the scaling and slicing behavior.


Properties

EqualityContract

protected System.Type EqualityContract { get; }
Property Value

Type


FixedEdges

The thickness of each "fixed" edge to use with 9-patch/9-slice scaling. Specifying these values can prevent corner distortion for images that have been designed for such scaling. See Nine-Slice Scaling for a detailed explanation.

public StardewUI.Layout.Edges FixedEdges { get; set; }
Property Value

Edges


Size

The size (width/height) of the sprite, in pixels.

public Microsoft.Xna.Framework.Point Size { get; }
Property Value

Point


SliceSettings

Additional settings for the scaling and slicing behavior.

public StardewUI.Graphics.SliceSettings SliceSettings { get; set; }
Property Value

SliceSettings


SourceRect

The inner area of the Texture in which the specific image is located, or null to draw the entire texture.

public Microsoft.Xna.Framework.Rectangle? SourceRect { get; set; }
Property Value

Nullable<Rectangle>


Texture

The texture containing the sprite's pixel data.

public Microsoft.Xna.Framework.Graphics.Texture2D Texture { get; set; }
Property Value

Texture2D