Base class for all frame types
Static methods
staticsort(frames:Array<FlxFrame>, prefixLength:Int, suffixLength:Int, warn:Bool = true):Void
Sorts frames based on the value of the frames' name between the prefix and suffix.
Uses Std.parseInt
to parse the value, if the result is null
, 0 is used, if the result
is a negative number, the absolute valute is used.
Parameters:
frames | The list of frames to sort |
---|---|
prefix | Everything in the frames' name before the order |
suffix | Everything in the frames' name after the order |
warn | Whether to warn on invalid names |
staticinlinesortFrames(frames:Array<FlxFrame>, prefix:String, ?suffix:String, warn:Bool = true):Void
Sorts frames based on the value of the frames' name between the prefix and suffix.
Uses Std.parseInt
to parse the value, if the result is null
, 0 is used, if the result
is a negative number, the absolute valute is used.
Parameters:
frames | The list of frames to sort |
---|---|
prefix | Everything in the frames' name before the order |
suffix | Everything in the frames' name after the order |
warn | Whether to warn on invalid names |
Variables
Methods
clipTo(clip:FlxRect, ?clippedFrame:FlxFrame):FlxFrame
Frame clipping
Parameters:
clip | Clipping rectangle to apply on frame |
---|---|
clippedFrame | The frame which will contain result of original frame clipping.
If |
Returns:
Result of applying frame clipping
copyTo(?clone:FlxFrame):FlxFrame
Copies data from this frame into specified frame.
Parameters:
clone | Frame to fill data with. If |
---|
Returns:
Frame with data of this frame.
paint(?bmd:BitmapData, ?point:Null<Point>, mergeAlpha:Bool = false, disposeIfNotEqual:Bool = false):BitmapData
Draws frame on specified BitmapData
object.
Parameters:
bmd |
|
---|---|
point | Where to draw this frame on the specified |
mergeAlpha | Whether to merge alphas or not.
(works like with |
disposeIfNotEqual | Whether dispose passed |
Returns:
Modified or newly created BitmapData
with frame image on it.
paintRotatedAndFlipped(?bmd:BitmapData, ?point:Null<Point>, rotation:FlxFrameAngle = FlxFrameAngle.ANGLE_0, flipX:Bool = false, flipY:Bool = false, mergeAlpha:Bool = false, disposeIfNotEqual:Bool = false):BitmapData
Draws rotated and flipped frame on specified BitmapData object.
Parameters:
bmd | BitmapData object to draw this frame on.
If |
---|---|
point | Where to draw this frame on the specified |
rotation | How much rotate the frame. |
flipX | Do we need to flip frame horizontally. |
flipY | Do we need to flip frame vertically. |
mergeAlpha | Whether to merge alphas or not
(works like with |
disposeIfNotEqual | Whether dispose passed |
Returns:
Modified or newly created BitmapData
with frame image on it.
prepareMatrix(mat:FlxMatrix, rotation:FlxFrameAngle = FlxFrameAngle.ANGLE_0, flipX:Bool = false, flipY:Bool = false):FlxMatrix
Prepares matrix for frame tile/triangles rendering.
Parameters:
mat | Matrix to transform/prepare |
---|---|
rotation | Rotation to apply to specified matrix. |
flipX | Do we need to flip frame horizontally |
flipY | Do we need to flip frame vertically |
Returns:
Transformed matrix which can be used for frame drawing.
setBorderTo(border:FlxPoint, ?frameToFill:FlxFrame):FlxFrame
Just a helper method for some frame adjusting. Try to not use it, since it may cause memory leaks.
Parameters:
border | Amount to clip from frame |
---|
Returns:
Clipped frame
subFrameTo(rect:FlxRect, ?frameToFill:FlxFrame):FlxFrame
Generates frame with specified subregion of this frame.
Parameters:
rect | Frame region to generate frame for. |
---|---|
frameToFill | Frame to fill with data. If |
Returns:
Specified frameToFill
object but filled with data.