Difference between revisions of "TileMap"

From GiderosMobile
Line 13: Line 13:
 
| style="width: 50%; vertical-align:top;"|
 
| style="width: 50%; vertical-align:top;"|
 
=== <translate>Methods</translate> ===
 
=== <translate>Methods</translate> ===
[[Special:MyLanguage/TileMap.new|TileMap.new]] ''<translate>creates a new TileMap instance</translate>''<br/><!-- GIDEROSMTD:TileMap.new -->
+
[[Special:MyLanguage/TileMap.new|TileMap.new]] ''<translate>creates a new TileMap instance</translate>''<br/><!-- GIDEROSMTD:TileMap.new(width,height,texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy,displaywidth,displayheight) creates a new TileMap instance -->
[[Special:MyLanguage/TileMap:clearTile|TileMap:clearTile]] ''<translate>set an empty tile at given indices</translate>''<br/><!-- GIDEROSMTD:TileMap:clearTile -->
+
[[Special:MyLanguage/TileMap:clearTile|TileMap:clearTile]] ''<translate>set an empty tile at given indices</translate>''<br/><!-- GIDEROSMTD:TileMap:clearTile(x,y) set an empty tile at given indices -->
[[Special:MyLanguage/TileMap:getTile|TileMap:getTile]] ''<translate>returns the index of the tile</translate>''<br/><!-- GIDEROSMTD:TileMap:getTile -->
+
[[Special:MyLanguage/TileMap:getTile|TileMap:getTile]] ''<translate>returns the index of the tile</translate>''<br/><!-- GIDEROSMTD:TileMap:getTile(x,y) returns the index of the tile -->
[[Special:MyLanguage/TileMap:setRepeat|TileMap:setRepeat]] ''<translate>Indicate if the tilemap should repeat itself</translate>''<br/><!-- GIDEROSMTD:TileMap:setRepeat -->
+
[[Special:MyLanguage/TileMap:setRepeat|TileMap:setRepeat]] ''<translate>Indicate if the tilemap should repeat itself</translate>''<br/><!-- GIDEROSMTD:TileMap:setRepeat(x,y) Indicate if the tilemap should repeat itself -->
[[Special:MyLanguage/TileMap:setTexture|TileMap:setTexture]] ''<translate>Change the tile texture/atlas used by the tilemap</translate>''<br/><!-- GIDEROSMTD:TileMap:setTexture -->
+
[[Special:MyLanguage/TileMap:setTexture|TileMap:setTexture]] ''<translate>Change the tile texture/atlas used by the tilemap</translate>''<br/><!-- GIDEROSMTD:TileMap:setTexture(texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy) Change the tile texture/atlas used by the tilemap -->
[[Special:MyLanguage/TileMap:setTile|TileMap:setTile]] ''<translate>sets the index of the tile</translate>''<br/><!-- GIDEROSMTD:TileMap:setTile -->
+
[[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 -->
+
[[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> ===
 
=== <translate>Constants</translate> ===
 
=== <translate>Constants</translate> ===
[[Special:MyLanguage/TileMap.FLIP_DIAGONAL|TileMap.FLIP_DIAGONAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_DIAGONAL -->
+
[[Special:MyLanguage/TileMap.FLIP_DIAGONAL|TileMap.FLIP_DIAGONAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_DIAGONAL 1-->
[[Special:MyLanguage/TileMap.FLIP_HORIZONTAL|TileMap.FLIP_HORIZONTAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_HORIZONTAL -->
+
[[Special:MyLanguage/TileMap.FLIP_HORIZONTAL|TileMap.FLIP_HORIZONTAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_HORIZONTAL 4-->
[[Special:MyLanguage/TileMap.FLIP_VERTICAL|TileMap.FLIP_VERTICAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_VERTICAL -->
+
[[Special:MyLanguage/TileMap.FLIP_VERTICAL|TileMap.FLIP_VERTICAL]]<br/><!-- GIDEROSCST:TileMap.FLIP_VERTICAL 2-->
 
|}
 
|}

Revision as of 15:33, 13 September 2018


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