SpriteComponent

Namespace: Murder.Components
Assembly: Murder.dll

public sealed struct SpriteComponent : IComponent

Implements: IComponent

⭐ Constructors

public SpriteComponent()
public SpriteComponent(Portrait portrait, int batchId)

Parameters
portrait Portrait
batchId int

public SpriteComponent(Portrait portrait)

Parameters
portrait Portrait

public SpriteComponent(Guid guid, Vector2 offset, ImmutableArray<T> id, int ySortOffset, bool rotate, bool flip, OutlineStyle highlightStyle, int targetSpriteBatch)

Parameters
guid Guid
offset Vector2
id ImmutableArray<T>
ySortOffset int
rotate bool
flip bool
highlightStyle OutlineStyle
targetSpriteBatch int

⭐ Properties

AnimationGuid

public Guid AnimationGuid { get; public set; }

The Guid of the Aseprite file.

Returns
Guid

CurrentAnimation

public string CurrentAnimation { get; }

Current playing animation id.

Returns
string

FlipWithFacing

public readonly bool FlipWithFacing;

Returns
bool

HighlightStyle

public OutlineStyle HighlightStyle { get; public set; }

Returns
OutlineStyle

NextAnimations

public ImmutableArray<T> NextAnimations { get; public set; }

Returns
ImmutableArray<T>

Offset

public readonly Vector2 Offset;

(0,0) is top left and (1,1) is bottom right

Returns
Vector2

RotateWithFacing

public readonly bool RotateWithFacing;

Returns
bool

TargetSpriteBatch

public readonly int TargetSpriteBatch;

Returns
int

UseUnscaledTime

public readonly bool UseUnscaledTime;

Returns
bool

YSortOffset

public int YSortOffset { get; public set; }

Returns
int

⭐ Methods

HasAnimation(string)

public bool HasAnimation(string animationName)

Parameters
animationName string

Returns
bool

IsPlaying(ImmutableArray)

public bool IsPlaying(ImmutableArray<T> animations)

Parameters
animations ImmutableArray<T>

Returns
bool

Play(ImmutableArray)

public SpriteComponent Play(ImmutableArray<T> id)

Parameters
id ImmutableArray<T>

Returns
SpriteComponent

Play(String[])

public SpriteComponent Play(String[] id)

Parameters
id string[]

Returns
SpriteComponent

PlayAfter(string)

public SpriteComponent PlayAfter(string id)

Parameters
id string

Returns
SpriteComponent

SetBatch(int)

public SpriteComponent SetBatch(int batch)

Parameters
batch int

Returns
SpriteComponent

WithPortrait(Portrait)

public SpriteComponent WithPortrait(Portrait portrait)

Parameters
portrait Portrait

Returns
SpriteComponent

WithSort(int)

public SpriteComponent WithSort(int sort)

Parameters
sort int

Returns
SpriteComponent