Module flower.SheetImage

Class that displays an image from a sheet of images, supporting TexturePacker's format.

Extends:

Info:

  • Release: V3.0.0
  • Author: Makoto

Functions

SheetImage:init (texture, sizeX, sizeY, spacing, margin, flipX, flipY) Constructor.
SheetImage:setTexture (texture) Sets the texture.
SheetImage:setTextureAtlas (atlas, flipX, flipY) Parses TexturePacker atlases and sets up the texture as a deck of images in the atlas.
SheetImage:setSheetSize (sizeX, sizeY, spacing, margin, flipX, flipY) Sets the size of the sheet (for quad-tiled texture atlas sheets).
SheetImage:setTileSize (tileWidth, tileHeight, spacing, margin, flipX, flipY) Sets the sheet depending on the size of the tile.
SheetImage:setFlip (flipX, flipY) Sets the texture flip.
SheetImage:setIndexByName (name) Sets the sheet's image index via a given subtexture name (for TexturePacker).


Functions

SheetImage:init (texture, sizeX, sizeY, spacing, margin, flipX, flipY)
Constructor.

Parameters:

  • texture Texture path, or texture
  • sizeX (option) The size of the sheet
  • sizeY (option) The size of the sheet
  • spacing (option)Spacing of the tiles
  • margin (option)Margin of the sheet
  • flipX (option)flipX
  • flipY (option)flipY
SheetImage:setTexture (texture)
Sets the texture.

Parameters:

  • texture Texture path, or texture
SheetImage:setTextureAtlas (atlas, flipX, flipY)
Parses TexturePacker atlases and sets up the texture as a deck of images in the atlas.

Parameters:

  • atlas Texture atlas
  • flipX (option)flipX
  • flipY (option)flipY
SheetImage:setSheetSize (sizeX, sizeY, spacing, margin, flipX, flipY)
Sets the size of the sheet (for quad-tiled texture atlas sheets).

Parameters:

  • sizeX The size of the sheet
  • sizeY The size of the sheet
  • spacing (option)Spacing of the tiles
  • margin (option)Margin of the sheet
  • flipX (option)flipX
  • flipY (option)flipY
SheetImage:setTileSize (tileWidth, tileHeight, spacing, margin, flipX, flipY)
Sets the sheet depending on the size of the tile.

Parameters:

  • tileWidth The width of the tile
  • tileHeight The height of the tile
  • spacing (option)Spacing of the tiles
  • margin (option)Margin of the sheet
  • flipX (option)flipX
  • flipY (option)flipY
SheetImage:setFlip (flipX, flipY)
Sets the texture flip.

Parameters:

  • flipX (option)flipX
  • flipY (option)flipY
SheetImage:setIndexByName (name)
Sets the sheet's image index via a given subtexture name (for TexturePacker).

Parameters:

  • name Sheet name.
generated by LDoc 1.3