AtlasCoordinates

Namespace: Murder.Core.Graphics
Assembly: Murder.dll

public sealed struct AtlasCoordinates

An image coordinate inside an atlas

⭐ Constructors

public AtlasCoordinates(string name, AtlasId atlasId, IntRectangle atlasRectangle, IntRectangle trimArea, Point size, int atlasIndex, int atlasWidth, int atlasHeight)

Parameters
name string
atlasId AtlasId
atlasRectangle IntRectangle
trimArea IntRectangle
size Point
atlasIndex int
atlasWidth int
atlasHeight int

⭐ Properties

Atlas

public Texture2D Atlas { get; }

Returns
Texture2D

AtlasId

public readonly AtlasId AtlasId;

Returns
AtlasId

AtlasIndex

public readonly int AtlasIndex;

Returns
int

AtlasSize

public Point AtlasSize { get; }

Returns
Point

Empty

public static AtlasCoordinates Empty;

Returns
AtlasCoordinates

Height

public int Height { get; }

Returns
int

Name

public readonly string Name;

Returns
string

Size

public readonly Point Size;

The real size of the image, without trimming

Returns
Point

SourceRectangle

public readonly IntRectangle SourceRectangle;

Returns
IntRectangle

TrimArea

public readonly IntRectangle TrimArea;

Returns
IntRectangle

UV

public readonly Rectangle UV;

Returns
Rectangle

Width

public int Width { get; }

Returns
int

⭐ Methods

Draw(Batch2D, Rectangle, Rectangle, Color, float, Vector3)

public void Draw(Batch2D spriteBatch, Rectangle clip, Rectangle target, Color color, float depthLayer, Vector3 blend)

Draws a partial image stored inside an atlas to the spritebatch to a specific rect

Parameters
spriteBatch Batch2D
clip Rectangle
target Rectangle
color Color
depthLayer float
blend Vector3

Draw(Batch2D, Vector2, Rectangle, Color, Vector2, float, Vector2, ImageFlip, Vector3, float)

public void Draw(Batch2D spriteBatch, Vector2 position, Rectangle clip, Color color, Vector2 scale, float rotation, Vector2 offset, ImageFlip imageFlip, Vector3 blend, float sort)

Draws a partial image stored inside an atlas to the spritebatch.

Parameters
spriteBatch Batch2D
position Vector2
clip Rectangle
color Color
scale Vector2
rotation float
offset Vector2
imageFlip ImageFlip
blend Vector3
sort float