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 |
Constructor
new(parent:FlxGraphic, angle:FlxFrameAngle = FlxFrameAngle.ANGLE_0, flipX:Bool = false, flipY:Bool = false, duration:Float = 0.0)
Variables
Methods
clip(rect:FlxRect):FlxFrame
Clips this frame to the desired rect
Parameters:
rect | Clipping rectangle to apply |
---|
clipTo(rect: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
contains(rect:FlxRect):Bool
Whether this frame fully contains the given rect. If clipping this frame to
the given rect would result in a smaller frame, the result is false
6.1.0
.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.
isContained(rect:FlxRect):Bool
Whether this frame is fully contained by the given rect. If clipping this frame to
the given rect would result in a smaller frame, the result is false
6.1.0
.overlaps(rect:FlxRect):Bool
Whether there is any overlap between this frame and the given rect. If clipping this frame to
the given rect would result in an empty frame, the result is false
6.1.0
.paint(?bmd:BitmapData, ?point: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: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.