Frames collection which you can apply bitmap filters to. WARNING: this frame collection doesn't use caching, so be careful or you will "leak" out memory very fast. You should destroy frames collections of this type manually.

Static methods

@:value({ heightInc : 0, widthInc : 0 })staticinlinefromFrames(frames:FlxFramesCollection, widthInc:Int = 0, heightInc:Int = 0, ?filters:Array<BitmapFilter>):FlxFilterFrames

Generates new frames collection from specified frames.

Parameters:

frames

Frames collection to generate filters for.

widthInc

How much frames should expand horizontally.

heightInc

How much frames should expend vertically.

filters

Optional filters array to apply.

Returns:

New frames collection which you can apply filters to.

Variables

filters:Array<BitmapFilter>

Filters applied to these frames

@:value(0)read onlyheightInc:Int = 0

How much frames should expand vertically

read onlysourceFrames:FlxFramesCollection

Original frames collection

@:value(0)read onlywidthInc:Int = 0

How much frames should expand horizontally

Methods

inlineaddFilter(filter:BitmapFilter):Void

Adds a filter to this frames collection.

Parameters:

filter

The filter to be added.

@:value({ updateFrames : false, saveAnimations : false })applyToSprite(spr:FlxSprite, saveAnimations:Bool = false, updateFrames:Bool = false):Void

Just helper method which "centers" sprite offsets

Parameters:

spr

Sprite to apply this frame collection.

saveAnimations

Whether to save sprite's animations or not.

updateFrames

Whether to regenerate frame BitmapDatas or not.

clearFilters():Void

Removes all filters from the frames.

removeFilter(filter:BitmapFilter):Void

Removes a filter from this frames collection.

Parameters:

filter

The filter to be removed.

Inherited Variables

Defined by FlxFramesCollection

read onlyborder:FlxPoint

How much space was trimmed around the original frames. Use addBorder() to add borders.

frames:Array<FlxFrame>

Array with all frames of this collection.

framesHash:Map<String, FlxFrame>

Hash of frames for this frame collection. Used only in FlxAtlasFrames and FlxBitmapFont (not implemented yet), but you can try to use it for other types of collections (give names to your frames).

read onlynumFrames:Int

Number of frames in this collection.

parent:FlxGraphic

Graphic object this frames belongs to.

read onlytype:FlxFrameCollectionType

Type of this frame collection. Used for faster type detection (less casting).

Inherited Methods

Defined by FlxFramesCollection

@:value({ flipY : false, flipX : false, angle : 0 })addAtlasFrame(frame:FlxRect, sourceSize:FlxPoint, offset:FlxPoint, ?name:String, angle:FlxFrameAngle = 0, flipX:Bool = false, flipY:Bool = false):FlxFrame

Adds new frame to this frame collection. This method runs additional check, and can add rotated frames (from texture atlases).

Parameters:

frame

Region of image.

sourceSize

Original size of packed image (if image had been cropped, then original size will be bigger than frame size).

offset

How frame region is located on original frame image (offset from top left corner of original image).

name

Name for this frame (name of packed image file).

angle

Rotation of packed image (can be 0, 90 or -90).

flipX

If packed image should be horizontally flipped.

flipY

If packed image should be vertically flipped.

Returns:

Newly created and added frame object.

addBorder(border:FlxPoint):FlxFramesCollection

Generates new frames collection from this collection but trims frames by specified borders.

Parameters:

border

How much space trim around the frames.

Returns:

Generated frames collection.

addEmptyFrame(size:FlxRect):FlxFrame

Adds empty frame into this frame collection. An empty frame is doing almost nothing for all the time.

Parameters:

size

Dimensions of the frame to add.

Returns:

Newly added empty frame.

addSpriteSheetFrame(region:FlxRect):FlxFrame

Adds new regular (not rotated) FlxFrame to this frame collection.

Parameters:

region

Region of image which new frame will display.

Returns:

Newly created FlxFrame object for specified region of image.

inlinegetByIndex(index:Int):FlxFrame

Finds frame in frames array by its index.

Parameters:

index

Index of the frame in the frames array.

Returns:

Frame with specified index in this frames collection (if there is one).

inlinegetByName(name:String):FlxFrame

Finds a frame in framesHash by its name.

Parameters:

name

The name of the frame to find.

Returns:

Frame with specified name (if there is one).

inlinegetFrameIndex(frame:FlxFrame):Int

Finds the index of the specified frame in the frames array.

Parameters:

frame

Frame to find.

Returns:

Index of the specified frame.

getIndexByName(name:String):Int

Finds frame index by its name.

Parameters:

name

Name of the frame.

Returns:

Index of the frame with specified name.

pushFrame(frameObj:FlxFrame):FlxFrame

Helper method for a adding frame to the collection.

Parameters:

frameObj

Frame to add.

Returns:

Added frame.