Difference between revisions of "TileMap:shift"

From GiderosMobile
Line 18: Line 18:
 
tilemap:shift(0, -1)  -- shifts the tile map to the up
 
tilemap:shift(0, -1)  -- shifts the tile map to the up
 
tilemap:shift(0, 1)  -- shifts the tile map to the down</source>
 
tilemap:shift(0, 1)  -- shifts the tile map to the down</source>
 +
 +
{{TileMap}}

Revision as of 03:25, 4 December 2019


Available since: Gideros 2011.6
Class: TileMap

Description

Shifts the tile map to change tile's graphic. The arguments are in tiles, not in pixels. By shifting the tile map one by one as needed, you can create dynamic tile maps.

 TileMap:shift(dx,dy)

Parameters

dx: (number) The x amount of shift in tiles
dy: (number) The y amount of shift in tiles

Examples

Example

tilemap:shift(-1, 0)  -- shifts the tile map to the left
tilemap:shift(1, 0)	  -- shifts the tile map to the right
tilemap:shift(0, -1)  -- shifts the tile map to the up
tilemap:shift(0, 1)   -- shifts the tile map to the down