Difference between revisions of "TileMap"

From GiderosMobile
Line 5: Line 5:
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
 
'''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
 +
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
<translate><br />
+
The [[Special:MyLanguage/TileMap|TileMap]] class is used to work with tile maps easily and efficiently.
The [[Special:MyLanguage/TileMap|TileMap]] class is used to work with tile maps easily and efficiently.<br />
+
 
<br />
+
Check ''Desert'' and ''Sewers'' examples provided with Gideros for usage of TileMap with export from editor.
Check ''Desert'' and ''Sewers'' examples provided with Gideros for usage of TileMap with export from editor</translate>
+
 
 
{|-
 
{|-
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
Line 20: Line 21:
 
[[Special:MyLanguage/TileMap:setTile|TileMap:setTile]] ''<translate>sets the index of the tile</translate>''<br/><!-- GIDEROSMTD:TileMap:setTile(x,y,tx,ty,flip,color,alpha) sets the index of the tile -->
 
[[Special:MyLanguage/TileMap:setTile|TileMap:setTile]] ''<translate>sets the index of the tile</translate>''<br/><!-- GIDEROSMTD:TileMap:setTile(x,y,tx,ty,flip,color,alpha) sets the index of the tile -->
 
[[Special:MyLanguage/TileMap:shift|TileMap:shift]] ''<translate>shifts the tile map</translate>''<br/><!-- GIDEROSMTD:TileMap:shift(dx,dy) shifts the tile map -->
 
[[Special:MyLanguage/TileMap:shift|TileMap:shift]] ''<translate>shifts the tile map</translate>''<br/><!-- GIDEROSMTD:TileMap:shift(dx,dy) shifts the tile map -->
 +
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== <translate>Events</translate> ===
 
=== <translate>Events</translate> ===
Line 27: Line 29:
 
[[Special:MyLanguage/TileMap.FLIP_VERTICAL|TileMap.FLIP_VERTICAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_VERTICAL 2-->
 
[[Special:MyLanguage/TileMap.FLIP_VERTICAL|TileMap.FLIP_VERTICAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_VERTICAL 2-->
 
|}
 
|}
 
{{TileMap}}
 

Revision as of 00:30, 10 December 2019


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2011.6
Inherits from: Sprite

Description

The TileMap class is used to work with tile maps easily and efficiently.

Check Desert and Sewers examples provided with Gideros for usage of TileMap with export from editor.

Methods

TileMap.new creates a new TileMap instance
TileMap:clearTile set an empty tile at given indices
TileMap:getTile returns the index of the tile
TileMap:setRepeat Indicate if the tilemap should repeat itself
TileMap:setTexture Change the tile texture/atlas used by the tilemap
TileMap:setTile sets the index of the tile
TileMap:shift shifts the tile map

Events

Constants

TileMap.FLIP_DIAGONAL
TileMap.FLIP_HORIZONTAL
TileMap.FLIP_VERTICAL