Difference between revisions of "TileMap:setTexture"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2018.2<br/>
'''<translate>Available since</translate>:''' Gideros 2018.2<br/>
+
'''Class:''' [[TileMap]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/TileMap|TileMap]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate><br />
+
Changes the tile texture/atlas used by the tilemap.
Change the tile texture/atlas used by the tilemap.<br />
 
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
TileMap:setTexture(texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy)
+
TileMap:setTexture(texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''texture''': (TextureBase) <translate>The texture used in rendering tile map</translate> <br/>
+
=== Parameters ===
'''tilewidth''': (number) <translate>The width of a tile in pixels</translate> <br/>
+
'''texture''': (TextureBase) the texture used in rendering tile map<br/>
'''tileheight''': (number) <translate>The height of a tile in pixels</translate> <br/>
+
'''tilewidth''': (number) the width of a tile in pixels<br/>
'''spacingx''': (number, default = 0) <translate>The x-spacing in pixels between the tiles in this tileset</translate> <br/>
+
'''tileheight''': (number) the height of a tile in pixels<br/>
'''spacingy''': (number, default = 0) <translate>The y-spacing in pixels between the tiles in this tileset</translate> <br/>
+
'''spacingx''': (number, default = 0) the x-spacing in pixels between the tiles in this tileset<br/>
'''marginx''': (number, default = 0) <translate>The x-margin from the top-left of the texture</translate> <br/>
+
'''spacingy''': (number, default = 0) the y-spacing in pixels between the tiles in this tileset<br/>
'''marginy''': (number, default = 0) <translate>The y-margin from the top-left of the texture</translate> <br/>
+
'''marginx''': (number, default = 0) the x-margin from the top-left of the texture<br/>
 +
'''marginy''': (number, default = 0) the y-margin from the top-left of the texture<br/>
  
 
{{TileMap}}
 
{{TileMap}}

Revision as of 02:54, 19 March 2023

Available since: Gideros 2018.2
Class: TileMap

Description

Changes the tile texture/atlas used by the tilemap.

TileMap:setTexture(texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy)

Parameters

texture: (TextureBase) the texture used in rendering tile map
tilewidth: (number) the width of a tile in pixels
tileheight: (number) the height of a tile in pixels
spacingx: (number, default = 0) the x-spacing in pixels between the tiles in this tileset
spacingy: (number, default = 0) the y-spacing in pixels between the tiles in this tileset
marginx: (number, default = 0) the x-margin from the top-left of the texture
marginy: (number, default = 0) the y-margin from the top-left of the texture