Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion flixel/graphics/atlas/AtlasBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,24 @@ typedef AtlasPos =
/**
* Rectangle struct use for atlas json parsing, { x:Float, y:Float, w:Float, h:Float }
*/
typedef AtlasRect = AtlasPos & AtlasSize;
@:forward
abstract AtlasRect(AtlasPos & AtlasSize) from AtlasPos & AtlasSize
{
public var l(get, never):Float; inline function get_l() return this.x;
public var r(get, never):Float; inline function get_r() return this.x + this.w;
public var t(get, never):Float; inline function get_t() return this.y;
public var b(get, never):Float; inline function get_b() return this.y + this.h;

overload public inline extern function toFlxRect(rect:flixel.math.FlxRect)
{
return rect.set(this.x, this.y, this.w, this.h);
}

overload public inline extern function toFlxRect()
{
return flixel.math.FlxRect.get(this.x, this.y, this.w, this.h);
}
}

typedef AtlasFrame =
{
Expand Down
Loading