Class AngeSprite
Artwork sprite data for rendering the game
Fields
Atlas
Instance of the atlas this sprite belongs to
Declaration
public Atlas Atlas
AtlasID
AngeHash of the atlas this sprite belongs to
Declaration
public int AtlasID
Duration
Animation duration of this sprite
Declaration
public int Duration
EMPTY
Declaration
public static readonly AngeSprite EMPTY
GlobalBorder
Border value in global space.
Declaration
public Int4 GlobalBorder
GlobalHeight
Height in global space. Calculate from the pixel rect height multiply Const.ART_SCALE
Declaration
public int GlobalHeight
GlobalWidth
Width in global space. Calculate from the pixel rect width multiply Const.ART_SCALE
Declaration
public int GlobalWidth
Group
Instance of the sprite group this sprite belongs to. Null if this sprite is individual.
Declaration
public SpriteGroup Group
ID
Global unique ID for this sprite. from RealName.AngeHash();
Declaration
public int ID
IsTrigger
True if this sprite is tagged as trigger.
Declaration
public bool IsTrigger
LocalZ
Z value for sort rendering cells
Declaration
public int LocalZ
PivotX
Pivot X (0 means left edge. 1000 means right edge)
Declaration
public int PivotX
PivotY
Pivot Y (0 means bottom edge. 1000 means top edge)
Declaration
public int PivotY
PixelRect
Rect position of the pixel data inside the atlas canvas
Declaration
public IRect PixelRect
Pixels
The pixels content data
Declaration
public Color32[] Pixels
RealName
Uniaue logical name of this sprite.
Declaration
public string RealName
Rule
Rule for auto tiling map blocks
Declaration
public BlockRule Rule
SummaryTint
Average color of the pixels
Declaration
public Color32 SummaryTint
Tag
Meta tag of this sprite. Multiple tags can be contains at same time.
Declaration
public Tag Tag
Methods
CopyTo(AngeSprite)
Copy the data to the given sprite
Declaration
public AngeSprite CopyTo(AngeSprite target)
Returns
Type | Description |
---|---|
AngeSprite | The target sprite |
CreateCopy()
Create a new sprite instance with same data with this one
Declaration
public AngeSprite CreateCopy()
MakeDedicatedForTexture(object, Sheet)
Link the given sprite to the texture
Declaration
public void MakeDedicatedForTexture(object texture, Sheet sheet)
RemoveFromDedicatedTexture(Sheet)
Remove the texture dedicated sprite
Declaration
public void RemoveFromDedicatedTexture(Sheet sheet)
ResizePixelRect(IRect, bool, out bool)
Set pixel content data to new size without delete the data inside
Declaration
public void ResizePixelRect(IRect newRect, bool resizeBorder, out bool contentChanged)
Parameters
Type | Name | Description |
---|---|---|
IRect | newRect | New pixel rect position |
bool | resizeBorder | True if auto resize the border |
bool | contentChanged | True if any pixel data changed |
SetPixelDirty()
Mark this sprite as changed without save
Declaration
public void SetPixelDirty()
ValidBorders(Direction8?)
Make sure the borders don't overlaps each others
Declaration
public void ValidBorders(Direction8? priority = null)