Class: SystemTileset

SystemTileset

A tileset of the game

new SystemTileset ()

Properties:
Name Type Description
collisions Array.<CollisionSquare> List of all the collisions according to the position on the texture
ownsAutotiles boolean Indicate if this tileset contains autotiles
ownsMountains boolean Indicate if this tileset contains mountains
ownsWalls boolean Indicate if this tileset contains walls
id number The tileset ID
picture SystemPicture The picture used for this tileset
autotiles Array.<number> All the IDs of used autotiles for this tileset
walls Array.<number> All the IDs of used walls for this tileset
mountains Array.<number> All the IDs of used mountains for this tileset
objects Array.<number> All the IDs of used 3D objects for this tileset

Methods

read (json)

Read the JSON associated to the tileset
Name Type Description
json Object Json object describing the tileset

getPath ()string

Get the path to the picture tileset
Returns:
Type Description
string

getSpecialString (specials)string

Get the string logic for special elements
Name Type Description
specials Array.<string> Special elements
Returns:
Type Description
string

getAutotilesString ()string

Get the string logic for autotiles
Returns:
Type Description
string

getWallsString ()string

Get the string logic for walls
Returns:
Type Description
string

getMountainsString ()string

Get the string logic for mountains
Returns:
Type Description
string

getMaxAutotilesOffsetTexture ()number

Get the max possible offset of an autotile texture
Returns:
Type Description
number

getMaxMountainOffsetTexture ()number

Get the max possible offset of a mountain texture
Returns:
Type Description
number

loadSpecials () async

Load all the specials

loadAutotiles () async

Load all the autotiles with reduced files

loadTextureAutotile (textureAutotile, texture, picture, offset, id)Array.<any> async

Load an autotile ID and add it to context rendering
Name Type Description
textureAutotile TextureSeveral The autotile several texture
texture THREE.Texture The texture to paint on
picture SystemPicture The picture to paint
offset number The offset
id number The picture id
Returns:
Type Description
Array.<any>

paintPictureAutotile (img, offset, point, id)

Paint the picture in texture
Name Type Description
img Image The image to draw
offset number The offset
point Array.<number> The in several texture
id number The picture id

updateTextureAutotile (textureAutotile, texture) async

Update texture of a TextureAutotile
Name Type Description
textureAutotile TextureSeveral The autotile several texture
texture THREE.Texture The texture to paint on

loadMountains () async

Load all the mountains with reduced files

loadTextureMountain (textureMountain, texture, picture, offset, id)Array.<any> async

Load a mountain ID and add it to context rendering
Name Type Description
textureMountain TextureSeveral The mountain several texture
texture THREE.Texture The texture to paint on
picture SystemPicture The picture to paint
offset number The offset
id number The picture id
Returns:
Type Description
Array.<any>

paintPictureMountain (img, offset, id)

Paint the picture in texture
Name Type Description
img Image The image to draw
offset number The offset
id number The picture id

updateTextureMountain (textureMountain, texture) async

Update texture of a TextureSeveral
Name Type Description
textureMountain TextureSeveral The mountain several texture
texture THREE.Texture The texture to paint on

loadWalls () async

Load all the walls

loadTextureWall (picture, id)THREE.ShaderMaterial async

Load a wall texture
Name Type Description
picture SystemPicture The picture to load
id number The picture id
Returns:
Type Description
THREE.ShaderMaterial