Constructor
new (parent : AtlasData, rect : Rectangle) : Void
Creates a new AtlasRegion
Parameters:
| parent | The AtlasData parent to use for rendering | |
| rect | Rectangle to set for width/height |
Variables
read only x : Float
read only y : Float
Functions
clip (clipRect : Rectangle, center : Vector2) : AtlasRegion
Clips an atlas region
Parameters:
| clipRect | A clip rectangle with coordinates local to the region | |
| center | The new center point |
Returns:
A new atlas region with the clipped coordinates
draw (x : Float, y : Float, scaleX : Float = 1, scaleY : Float = 1, angle : Float = 0, color : Color = Color.White, alpha : Float = 1, shader : Shader, smooth : Bool, blend : BlendMode, clipRect : Rectangle, flexibleLayer : Bool = false) : Void
Prepares tile data for rendering
Parameters:
| x | The x-axis location to draw the tile | |
| y | The y-axis location to draw the tile | |
| shader | The shader to use for drawing | |
| scaleX | The scale value for the x-axis | |
| scaleY | The scale value for the y-axis | |
| angle | An angle to rotate the tile in degrees | |
| red | A red tint value | |
| green | A green tint value | |
| blue | A blue tint value | |
| alpha | The tile's opacity | |
| smooth | Whether to draw with antialiasing | |
| blend | Blend mode | |
| clipRect | Clipping rectangle |
drawMatrix (tx : Float, ty : Float, a : Float, b : Float, c : Float, d : Float, color : Color = Color.White, alpha : Float = 1, shader : Shader, smooth : Bool, blend : BlendMode, clipRect : Rectangle, flexibleLayer : Bool = false) : Void
Prepares tile data for rendering using a matrix
Parameters:
| tx | X-Axis translation | |
| ty | Y-Axis translation | |
| a | Top-left | |
| b | Top-right | |
| c | Bottom-left | |
| d | Bottom-right | |
| shader | The shader to use for drawing | |
| red | Red color value | |
| green | Green color value | |
| blue | Blue color value | |
| alpha | The tile's opacity | |
| smooth | Whether to draw with antialiasing | |
| blend | Blend mode | |
| clipRect | Clipping rectangle |