Flixel Animate Functions
Functions for creating special Lua Sprites that can use Animate Atlas.
loadAnimateAtlas
loadAnimateAtlas(tag:String, folderOrImg:String, ?spriteJson:String = null, ?animationJson:String = null):Void
Creates a Lua Flixel Animate Sprite.
- tag - Lua Flixel Animate Sprite nametag.
- folderOrImg - Spritemap .PNG file path.
- spriteJson (Optional) - Spritemap .JSON file path, will use the value in "folderOrImg" if missing.
- animationJson (Optional) - Animation .JSON file path, will use the value in "folderOrImg" if missing.
Examples:
- loadAnimateAtlas('mySprite', 'characters/atlasTest') - Loads the Atlas folder mods/My-Mod/images/characters/atlasTest.
- loadAnimateAtlas('mySprite', 'characters/atlasTest/spritemap1', 'characters/atlasTest/spritemap1', 'characters/atlasTest/Animation') - This will load the following Animate Atlas files consecutively: mods/My-Mod/images/characters/spritemap1.png, mods/My-Mod/images/characters/spritemap1.json, mods/My-Mod/images/characters/Animation.json.
addAnimationBySymbol
addAnimationBySymbol(tag:String, name:String, symbol:String, ?framerate:Int = 24, ?loop:Bool = true):Void
Adds an animation from a symbol.
- tag - Lua Flixel Animate Sprite nametag.
- name - Animation name.
- symbol - Symbol name in Adobe Animate (Folder should be included in this!).
- framerate (Optional) - Animation FPS.
- loop (Optional) - Should the animation loop?
Examples:
- addAnimationBySymbol('mySprite', 'idle', 'Test Anim Idle') - Adds an animation named "idle", symbol is named "Test Anim Idle" on Animate, running at 24 FPS and loop enabled.
- addAnimationBySymbol('mySprite', 'spin', 'Test Spin', 30, false) - Adds an animation named "spin", symbol is named "Test Spin" on Animate, running at 30 FPS and loop disabled.
addAnimationBySymbolIndices
addAnimationBySymbolIndices(tag:String, name:String, symbol:String, indices:String, ?framerate:Int = 24, ?loop:Bool = true):Void
Adds an animation from a symbol using specific frame indices.
- tag - Lua Flixel Animate Sprite nametag.
- name - Animation name.
- symbol - Symbol name in Adobe Animate (Folder should be included in this!).
- indices - Animation frames, formatted as a string separated by commas (e.g., "0,1,2,3").
- framerate (Optional) - Animation FPS.
- loop (Optional) - Should the animation loop?
Examples:
- addAnimationBySymbolIndices('mySprite', 'idle', 'Test Anim Idle', '0,1,2,3,4,5,6,7') - Adds "idle" using the specified frame indices.
addAnimationByFrameLabel
addAnimationByFrameLabel(tag:String, name:String, label:String, ?framerate:Int = 24, ?loop:Bool = true):Void
Adds an animation from a frame label.
- tag - Lua Flixel Animate Sprite nametag.
- name - Animation name.
- label - Frame label name in Adobe Animate.
- framerate (Optional) - Animation FPS.
- loop (Optional) - Should the animation loop?
Examples:
- addAnimationByFrameLabel('mySprite', 'idle', 'IdleLabel') - Adds an animation named "idle" from the frame label "IdleLabel", running at 24 FPS and loop enabled.
- addAnimationByFrameLabel('mySprite', 'walk', 'WalkLabel', 30, false) - Adds an animation named "walk" from the frame label "WalkLabel", running at 30 FPS and loop disabled.
addAnimationByFrameLabelIndices
addAnimationByFrameLabelIndices(tag:String, name:String, label:String, indices:String, ?framerate:Int = 24, ?loop:Bool = true):Void
Adds an animation from a frame label using specific frame indices.
- tag - Lua Flixel Animate Sprite nametag.
- name - Animation name.
- label - Frame label name in Adobe Animate.
- indices - Animation frames, formatted as a string separated by commas (e.g., "0,1,2,3").
- framerate (Optional) - Animation FPS.
- loop (Optional) - Should the animation loop?
Examples:
- addAnimationByFrameLabelIndices('mySprite', 'idle', 'IdleLabel', '0,1,2,3') - Adds "idle" from the frame label "IdleLabel" using the specified frame indices.