Difference between revisions of "TileMap:shift"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/TileMap|TileMap]]<br/>
+
'''Class:''' [[TileMap]]<br/>
=== <translate>Description</translate> ===
+
 
<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 />
+
=== Description ===
<br /></translate>
+
Shifts the tile map to change tile 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.
<source lang="lua">
+
<syntaxhighlight lang="lua">
TileMap:shift(dx,dy)
+
TileMap:shift(dx,dy)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''dx''': (number) <translate>The x amount of shift in tiles</translate> <br/>
+
=== Parameters ===
'''dy''': (number) <translate>The y amount of shift in tiles</translate> <br/>
+
'''dx''': (number) the x amount of shift in tiles<br/>
=== <translate>Examples</translate> ===
+
'''dy''': (number) the y amount of shift in tiles<br/>
'''Example'''<br/>
+
 
<source lang="lua">tilemap:shift(-1, 0) -- shifts the tile map to the left
+
=== Examples ===
tilemap:shift(1, 0)   -- shifts the tile map to the right
+
<syntaxhighlight lang="lua">
tilemap:shift(0, -1) -- shifts the tile map to the up
+
tilemap:shift(-1, 0) -- shifts the tile map to the left
tilemap:shift(0, 1)   -- shifts the tile map to the down</source>
+
tilemap:shift(1, 0) -- shifts the tile map to the right
 +
tilemap:shift(0, -1) -- shifts the tile map up
 +
tilemap:shift(0, 1) -- shifts the tile map down
 +
</syntaxhighlight>
 +
 
 +
{{TileMap}}

Latest revision as of 14:33, 13 July 2023

Available since: Gideros 2011.6
Class: TileMap

Description

Shifts the tile map to change tile 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

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 up
tilemap:shift(0, 1) -- shifts the tile map down