File hp/display/SpriteSheet.lua
Functions
M:copyParams (params) | Set the parameter setter function. |
M:getSheetAnim (name, Animation) | Returns the animation data with the specified name. |
M:init (params) | The constructor. |
M:isCurrentAnim (name) | Check the current animation with the specified name. |
M:playAnim (name) | Start the animation. |
M:setSheetAnim (name, indexes, sec, mode) | Set the data to move the key frame animation. |
M:setSheetAnims (sheetAnims) | Set the data to move the key frame animations. See M:setSheetAnim function. |
M:setSheets (sheets) | Set the data sheet. Sheet in accordance with the following format: Please. {x = Start position, y = Start position, width = The width of the sheet, height = The height of the sheet} TODO:Setting of the flip. |
M:setTileSize (tileX, tileY) | Sets the tile size. |
M:setTiledSheets (tileWidth, tileHeight, tileX, tileY, spacing, margin) | Set the sheet data in the form of tiles. |
M:stopAnim () | Stop the animation. |
Tables
SpriteSheet | This is a class to draw the sheet switching. |
Functions
- M:copyParams (params)
-
Set the parameter setter function.
Parameters
-
params: Parameter is set to Object.
-
params: Parameter is set to Object.
- M:getSheetAnim (name, Animation)
-
Returns the animation data with the specified name.
Parameters
- name:
- Animation: name.
Return value:
MOAIAnim instance - M:init (params)
-
The constructor.
Parameters
-
params: (option)Parameter is set to Object.
params:
texture:Path of the texture. Or, MOAITexture instance.
sheets:See setSheets function.
sheetAnims = See setSheetAnims function.
Return value:
instance -
params: (option)Parameter is set to Object.
- M:isCurrentAnim (name)
-
Check the current animation with the specified name.
Parameters
- name: Animation name.
Return value:
If the current animation is true. - M:playAnim (name)
-
Start the animation.
Parameters
- name:
- M:setSheetAnim (name, indexes, sec, mode)
-
Set the data to move the key frame animation.
Parameters
- name: Animation name.
- indexes: Key sequence.
- sec: Seconds to move the key.
- mode: (option)Mode is set to MOAIAnim.(The default is MOAITimer.LOOP)
- M:setSheetAnims (sheetAnims)
-
Set the data to move the key frame animations.
See M:setSheetAnim function.
Parameters
- sheetAnims: table is set to setSheetAnim.
- M:setSheets (sheets)
-
Set the data sheet.
Sheet in accordance with the following format: Please.
{x = Start position, y = Start position, width = The width of the sheet, height = The height of the sheet}
TODO:Setting of the flip.Parameters
- sheets: sheet data
- M:setTileSize (tileX, tileY)
-
Sets the tile size.
Parameters
- tileX: number of tiles in the x-direction.
- tileY: number of tiles in the y-direction.
- M:setTiledSheets (tileWidth, tileHeight, tileX, tileY, spacing, margin)
-
Set the sheet data in the form of tiles.
Parameters
- tileWidth: The width of the tile.
- tileHeight: The height of the tile.
- tileX: (option)number of tiles in the x-direction.
- tileY: (option)number of tiles in the y-direction.
- spacing: (option)Spaces between tiles.
- margin: (option)Margins of the Start position
- M:stopAnim ()
- Stop the animation.