Difference between revisions of "TileMap:shift"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== 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.<br />
+
<translate>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.<br />
<br />
+
<br /></translate>
 
<source lang="lua">
 
<source lang="lua">
 
  TileMap:shift(dx,dy)
 
  TileMap:shift(dx,dy)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''dx''': (number) The x amount of shift in tiles <br/>
+
'''dx''': (number) <translate>The x amount of shift in tiles</translate> <br/>
'''dy''': (number) The y amount of shift in tiles <br/>
+
'''dy''': (number) <translate>The y amount of shift in tiles</translate> <br/>
 
=== Examples ===
 
=== Examples ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">tilemap:shift(-1, 0)  -- shifts the tile map to the left<br />
+
<source lang="lua">tilemap:shift(-1, 0)  -- shifts the tile map to the left
tilemap:shift(1, 0)   -- shifts the tile map to the right<br />
+
tilemap:shift(1, 0)   -- shifts the tile map to the right
tilemap:shift(0, -1)  -- shifts the tile map to the up<br />
+
tilemap:shift(0, -1)  -- shifts the tile map to the up
tilemap:shift(0, 1)  -- shifts the tile map to the down<br /></source>
+
tilemap:shift(0, 1)  -- shifts the tile map to the down</source>

Revision as of 14:34, 23 August 2018

Available since: Gideros 2011.6

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