A collection of extension methods for flixel.FlxSprite
Static methods
staticinlineadd_animations_from_json (sprite:FlxSprite, json:String):Void
Add animations from JSON file
* @param sprite input sprite
* @param json json array of objects with fields { "name":string, "frames":number[], "speed":number, "loop":boolean }
staticinlinedraw_dashed_line (sprite:FlxSprite, p1:FlxPoint, p2:FlxPoint, segments:Int, color:Int = 0xFFFFFFFF, thickness:Int = 1):Void
staticinlinedraw_dashed_rect (sprite:FlxSprite, rect:FlxRect, segment_length:Int, color:Int = 0xFFFFFFFF, thickness:Int = 1):Void
staticinlineget_anchor (sprite:FlxSprite):FlxPoint
Returns a bottom center point of a FlxSprite
* @param sprite input sprite
* @return FlxPoint
staticinlinemake_anchored_hitbox (sprite:FlxSprite, width:Float, height:Float):Void
Creates a hitbox and aligns it to the bottom center point of a FlxSprite's frame
* @param sprite input sprite
* @param width hitbox width
* @param height hitbox height
staticinlinemake_and_center_hitbox (sprite:FlxSprite, width:Float, height:Float):Void
Creates a hitbox and centers it on a FlxSprite's frame
* @param sprite input sprite
* @param width hitbox width
* @param height hitbox height
staticinlineset_anchor_position (sprite:FlxSprite, point:FlxPoint):Void
Sets the anchor (bottom center) position of a FlxSprite using a FlxPoint
* @param sprite input sprite
* @param point anchor position
staticinlineset_facing_flip_horizontal (sprite:FlxSprite, graphic_facing_right:Bool = true):Void
Sets both right and left facing flip
* @param sprite input sprite
* @param graphic_facing_right Whether or not the sprite's graphic is facing right
staticinlineset_midpoint_position (sprite:FlxSprite, point:FlxPoint):Void
Sets the midpoint position of a FlxSprite using a FlxPoint
* @param sprite input sprite
* @param point midpoint position
staticinlineset_position (sprite:FlxSprite, point:FlxPoint):Void
Sets the position of a FlxSprite using a FlxPoint
* @param sprite input sprite
* @param point position