Difference between revisions of "TileMap:setTexture"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2018.2<br/> === Description === <br /> Change the tile texture/atlas used by the tilemap.<br /> <br /> <source lang="lua"> = TileMap:s...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''Available since:''' Gideros 2018.2<br/> | '''Available since:''' Gideros 2018.2<br/> | ||
+ | '''Class:''' [[TileMap]]<br/> | ||
+ | |||
=== Description === | === Description === | ||
− | + | Changes the tile texture/atlas used by the tilemap. | |
− | + | <syntaxhighlight lang="lua"> | |
− | + | TileMap:setTexture(texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy) | |
− | < | + | </syntaxhighlight> |
− | + | ||
− | </ | + | === Parameters === |
− | '''texture | + | '''texture''': (TextureBase) the texture used in rendering tile map<br/> |
− | '''tilewidth | + | '''tilewidth''': (number) the width of a tile in pixels<br/> |
− | '''tileheight | + | '''tileheight''': (number) the height of a tile in pixels<br/> |
− | '''spacingx | + | '''spacingx''': (number, default = 0) the x-spacing in pixels between the tiles in this tileset<br/> |
− | '''spacingy | + | '''spacingy''': (number, default = 0) the y-spacing in pixels between the tiles in this tileset<br/> |
− | '''marginx | + | '''marginx''': (number, default = 0) the x-margin from the top-left of the texture<br/> |
− | '''marginy | + | '''marginy''': (number, default = 0) the y-margin from the top-left of the texture<br/> |
+ | |||
+ | {{TileMap}} |
Latest revision as of 14:33, 13 July 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