Difference between revisions of "TileMap:setTexture"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Changes the tile texture/atlas used by the tilemap.
 
Changes the tile texture/atlas used by the tilemap.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
TileMap:setTexture(texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy)
 
TileMap:setTexture(texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===

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