Difference between revisions of "TileMap.new"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/TileMap|TileMap]]<br/>
+
'''Class:''' [[TileMap]]<br/>
=== <translate>Description</translate> ===
+
 
<translate><br />
+
=== Description ===
Creates a new [[Special:MyLanguage/TileMap|TileMap]] instance.<br />
+
Creates a new '''TileMap''' instance.
<br /></translate>
+
<syntaxhighlight lang="lua">
<source lang="lua">
+
TileMap.new(width,height,texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy,displaywidth,displayheight)
TileMap.new(width,height,texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy,displaywidth,displayheight)
+
</syntaxhighlight>
</source>
+
 
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''width''': (number) <translate>The width of the map in tiles</translate> <br/>
+
'''width''': (number) the width of the map in tiles<br/>
'''height''': (number) <translate>The height of the map in tiles</translate> <br/>
+
'''height''': (number) the height of the map in tiles<br/>
'''texture''': (TextureBase) <translate>The texture used in rendering tile map</translate> <br/>
+
'''texture''': (TextureBase) the texture used in rendering tile map<br/>
'''tilewidth''': (number) <translate>The width of a tile in pixels</translate> <br/>
+
'''tilewidth''': (number) the width of a tile in pixels<br/>
'''tileheight''': (number) <translate>The height of a tile in pixels</translate> <br/>
+
'''tileheight''': (number) the height of a tile in pixels<br/>
'''spacingx''': (number, default = 0) <translate>The x-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/>
'''spacingy''': (number, default = 0) <translate>The y-spacing in pixels between the tiles in this tileset</translate> <br/>
+
'''spacingy''': (number, default = 0) the y-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/>
+
'''marginx''': (number, default = 0) the x-margin from the top-left of the texture<br/>
'''marginy''': (number, default = 0) <translate>The y-margin from the top-left of the texture</translate> <br/>
+
'''marginy''': (number, default = 0) the y-margin from the top-left of the texture<br/>
'''displaywidth''': (number, default = tilewidth) <translate>The display width of a tile in pixels</translate> <br/>
+
'''displaywidth''': (number, default = tilewidth) the display width of a tile in pixels<br/>
'''displayheight''': (number, default = tileheight) <translate>The display height of a tile in pixels</translate> <br/>
+
'''displayheight''': (number, default = tileheight) the display height of a tile in pixels<br/>
 +
 
 +
{{TileMap}}

Latest revision as of 14:33, 13 July 2023

Available since: Gideros 2011.6
Class: TileMap

Description

Creates a new TileMap instance.

TileMap.new(width,height,texture,tilewidth,tileheight,spacingx,spacingy,marginx,marginy,displaywidth,displayheight)

Parameters

width: (number) the width of the map in tiles
height: (number) the height of the map in tiles
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
displaywidth: (number, default = tilewidth) the display width of a tile in pixels
displayheight: (number, default = tileheight) the display height of a tile in pixels