phaser/v2-community/resources/docgen/output/Phaser.Tilemap.json
2016-11-23 00:17:46 +00:00

1 line
No EOL
46 KiB
JSON
Executable file

{"class":{"name":"Phaser.Tilemap","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"Game reference to the currently running game.","optional":false,"default":null},{"name":"key","type":["string"],"help":"The key of the tilemap data as stored in the Cache. If you're creating a blank map either leave this parameter out or pass `null`.","optional":true,"default":null},{"name":"tileWidth","type":["number"],"help":"The pixel width of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.","optional":true,"default":"32"},{"name":"tileHeight","type":["number"],"help":"The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.","optional":true,"default":"32"},{"name":"width","type":["number"],"help":"The width of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.","optional":true,"default":"10"},{"name":"height","type":["number"],"help":"The height of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.","optional":true,"default":"10"}],"help":"Creates a new Phaser.Tilemap object. The map can either be populated with data from a Tiled JSON file or from a CSV file.\\nTo do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.\\nWhen using CSV data you must provide the key and the tileWidth and tileHeight parameters.\\nIf creating a blank tilemap to be populated later, you can either specify no parameters at all and then use `Tilemap.create` or pass the map and tile dimensions here.\\nNote that all Tilemaps use a base tile size to calculate dimensions from, but that a TilemapLayer may have its own unique tile size that overrides it.\\nA Tile map is rendered to the display using a TilemapLayer. It is not added to the display list directly itself.\\nA map may have multiple layers. You can perform operations on the map data such as copying, pasting, filling and shuffling the tiles around."},"consts":[{"name":"CSV","type":"number","help":"","line":163},{"name":"EAST","type":"number","help":"","line":181},{"name":"NORTH","type":"number","help":"","line":175},{"name":"SOUTH","type":"number","help":"","line":187},{"name":"TILED_JSON","type":"number","help":"","line":169},{"name":"WEST","type":"number","help":"","line":193}],"methods":{"public":[{"name":"addTilesetImage","static":false,"returns":{"types":["Phaser.Tileset"],"help":"Returns the Tileset object that was created or updated, or null if it failed."},"help":"Adds an image to the map to be used as a tileset. A single map may use multiple tilesets.\\nNote that the tileset name can be found in the JSON file exported from Tiled, or in the Tiled editor.","line":254,"public":true,"protected":false,"private":false,"parameters":[{"name":"tileset","type":["string"],"help":"The name of the tileset as specified in the map data.","optional":false,"default":null},{"name":"key","type":["string"],"help":"The key of the Phaser.Cache image used for this tileset. If not specified it will look for an image with a key matching the tileset parameter.","optional":true,"default":null},{"name":"tileWidth","type":["number"],"help":"The width of the tiles in the Tileset Image. If not given it will default to the map.tileWidth value, if that isn't set then 32.","optional":true,"default":"32"},{"name":"tileHeight","type":["number"],"help":"The height of the tiles in the Tileset Image. If not given it will default to the map.tileHeight value, if that isn't set then 32.","optional":true,"default":"32"},{"name":"tileMargin","type":["number"],"help":"The width of the tiles in the Tileset Image. If not given it will default to the map.tileWidth value.","optional":true,"default":"0"},{"name":"tileSpacing","type":["number"],"help":"The height of the tiles in the Tileset Image. If not given it will default to the map.tileHeight value.","optional":true,"default":"0"},{"name":"gid","type":["number"],"help":"If adding multiple tilesets to a blank\/dynamic map, specify the starting GID the set will use here.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"copy","static":false,"returns":{"types":["array"],"help":"An array of the tiles that were copied."},"help":"Copies all of the tiles in the given rectangular block into the tilemap data buffer.","line":1383,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the top left of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to copy the tiles from.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"create","static":false,"returns":{"types":["Phaser.TilemapLayer"],"help":"The TilemapLayer object. This is an extension of Phaser.Image and can be moved around the display list accordingly."},"help":"Creates an empty map of the given dimensions and one blank layer. If layers already exist they are erased.","line":209,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the default layer of the map.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the map in tiles.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the map in tiles.","optional":false,"default":null},{"name":"tileWidth","type":["number"],"help":"The width of the tiles the map uses for calculations.","optional":false,"default":null},{"name":"tileHeight","type":["number"],"help":"The height of the tiles the map uses for calculations.","optional":false,"default":null},{"name":"group","type":["Phaser.Group"],"help":"Optional Group to add the layer to. If not specified it will be added to the World group.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"createBlankLayer","static":false,"returns":{"types":["Phaser.TilemapLayer"],"help":"The TilemapLayer object. This is an extension of Phaser.Image and can be moved around the display list accordingly."},"help":"Creates a new and empty layer on this Tilemap. By default TilemapLayers are fixed to the camera.","line":471,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of this layer. Must be unique within the map.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the layer in tiles.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the layer in tiles.","optional":false,"default":null},{"name":"tileWidth","type":["number"],"help":"The width of the tiles the layer uses for calculations.","optional":false,"default":null},{"name":"tileHeight","type":["number"],"help":"The height of the tiles the layer uses for calculations.","optional":false,"default":null},{"name":"group","type":["Phaser.Group"],"help":"Optional Group to add the layer to. If not specified it will be added to the World group.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"createFromObjects","static":false,"returns":null,"help":"Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is\\ngiven it will be created in the World. All properties from the map data objectgroup are copied across to the Sprite, so you can use this as an easy way to\\nconfigure Sprite properties from within the map editor. For example giving an object a property of alpha: 0.5 in the map editor will duplicate that when the\\nSprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.","line":378,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the Object Group to create Sprites from.","optional":false,"default":null},{"name":"gid","type":["number"],"help":"The layer array index value, or if a string is given the layer name within the map data.","optional":false,"default":null},{"name":"key","type":["string"],"help":"The Game.cache key of the image that this Sprite will use.","optional":false,"default":null},{"name":"frame","type":["number","string"],"help":"If the Sprite image contains multiple frames you can specify which one to use here.","optional":true,"default":null},{"name":"exists","type":["boolean"],"help":"The default exists state of the Sprite.","optional":true,"default":"true"},{"name":"autoCull","type":["boolean"],"help":"The default autoCull state of the Sprite. Sprites that are autoCulled are culled from the camera if out of its range.","optional":true,"default":"false"},{"name":"group","type":["Phaser.Group"],"help":"Group to add the Sprite to. If not specified it will be added to the World group.","optional":true,"default":"Phaser.World"},{"name":"CustomClass","type":["object"],"help":"If you wish to create your own class, rather than Phaser.Sprite, pass the class here. Your class must extend Phaser.Sprite and have the same constructor parameters.","optional":true,"default":"Phaser.Sprite"},{"name":"adjustY","type":["boolean"],"help":"By default the Tiled map editor uses a bottom-left coordinate system. Phaser uses top-left. So most objects will appear too low down. This parameter moves them up by their height.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"createLayer","static":false,"returns":{"types":["Phaser.TilemapLayer"],"help":"The TilemapLayer object. This is an extension of Phaser.Sprite and can be moved around the display list accordingly."},"help":"Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.\\nThe `layer` parameter is important. If you've created your map in Tiled then you can get this by looking in Tiled and looking at the Layer name.\\nOr you can open the JSON file it exports and look at the layers[].name value. Either way it must match.\\nIf you wish to create a blank layer to put your own tiles on then see Tilemap.createBlankLayer.","line":434,"public":true,"protected":false,"private":false,"parameters":[{"name":"layer","type":["number","string"],"help":"The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The rendered width of the layer, should never be wider than Game.width. If not given it will be set to Game.width.","optional":true,"default":null},{"name":"height","type":["number"],"help":"The rendered height of the layer, should never be wider than Game.height. If not given it will be set to Game.height.","optional":true,"default":null},{"name":"group","type":["Phaser.Group"],"help":"Optional Group to add the object to. If not specified it will be added to the World group.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Removes all layer data from this tile map and nulls the game reference.\\nNote: You are responsible for destroying any TilemapLayer objects you generated yourself, as Tilemap doesn't keep a reference to them.","line":1764,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"dump","static":false,"returns":null,"help":"Dumps the tilemap data out to the console.","line":1722,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"fill","static":false,"returns":null,"help":"Fills the given area with the specified tile.","line":1685,"public":true,"protected":false,"private":false,"parameters":[{"name":"index","type":["number"],"help":"The index of the tile that the area will be filled with.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width in tiles of the area to operate on.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height in tiles of the area to operate on.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"forEach","static":false,"returns":null,"help":"For each tile in the given area defined by x\/y and width\/height run the given callback.","line":1535,"public":true,"protected":false,"private":false,"parameters":[{"name":"callback","type":["number"],"help":"The callback. Each tile in the given area will be passed to this callback as the first and only parameter.","optional":false,"default":null},{"name":"context","type":["number"],"help":"The context under which the callback should be run.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width in tiles of the area to operate on.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height in tiles of the area to operate on.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getImageIndex","static":false,"returns":{"types":["number"],"help":"The index of the image in this tilemap, or null if not found."},"help":"Gets the image index based on its name.","line":598,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the image to get.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getLayerIndex","static":false,"returns":{"types":["number"],"help":"The index of the layer in this tilemap, or null if not found."},"help":"Gets the layer index based on its name.","line":572,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the layer to get.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getObjectIndex","static":false,"returns":{"types":["number"],"help":"The index of the object in this tilemap, or null if not found."},"help":"Gets the object index based on its name.","line":611,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the object to get.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getTile","static":false,"returns":{"types":["Phaser.Tile"],"help":"The tile at the given coordinates or null if no tile was found or the coordinates were invalid."},"help":"Gets a tile from the Tilemap Layer. The coordinates are given in tile values.","line":1316,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position to get the tile from (given in tile units, not pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position to get the tile from (given in tile units, not pixels)","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to get the tile from.","optional":true,"default":null},{"name":"nonNull","type":["boolean"],"help":"If true getTile won't return null for empty tiles, but a Tile object with an index of -1.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"getTileAbove","static":false,"returns":null,"help":"Gets the tile above the tile coordinates given.\\nMostly used as an internal function by calculateFaces.","line":987,"public":true,"protected":false,"private":false,"parameters":[{"name":"layer","type":["number"],"help":"The local layer index to get the tile from. Can be determined by Tilemap.getLayer().","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getTileBelow","static":false,"returns":null,"help":"Gets the tile below the tile coordinates given.\\nMostly used as an internal function by calculateFaces.","line":1007,"public":true,"protected":false,"private":false,"parameters":[{"name":"layer","type":["number"],"help":"The local layer index to get the tile from. Can be determined by Tilemap.getLayer().","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getTileLeft","static":false,"returns":null,"help":"Gets the tile to the left of the tile coordinates given.\\nMostly used as an internal function by calculateFaces.","line":1027,"public":true,"protected":false,"private":false,"parameters":[{"name":"layer","type":["number"],"help":"The local layer index to get the tile from. Can be determined by Tilemap.getLayer().","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getTileRight","static":false,"returns":null,"help":"Gets the tile to the right of the tile coordinates given.\\nMostly used as an internal function by calculateFaces.","line":1047,"public":true,"protected":false,"private":false,"parameters":[{"name":"layer","type":["number"],"help":"The local layer index to get the tile from. Can be determined by Tilemap.getLayer().","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate to get the tile from. In tiles, not pixels.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getTileWorldXY","static":false,"returns":{"types":["Phaser.Tile"],"help":"The tile at the given coordinates."},"help":"Gets a tile from the Tilemap layer. The coordinates are given in pixel values.","line":1358,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position to get the tile from (given in pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position to get the tile from (given in pixels)","optional":false,"default":null},{"name":"tileWidth","type":["number"],"help":"The width of the tiles. If not given the map default is used.","optional":true,"default":null},{"name":"tileHeight","type":["number"],"help":"The height of the tiles. If not given the map default is used.","optional":true,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to get the tile from.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getTilesetIndex","static":false,"returns":{"types":["number"],"help":"The index of the tileset in this tilemap, or null if not found."},"help":"Gets the tileset index based on its name.","line":585,"public":true,"protected":false,"private":false,"parameters":[{"name":"name","type":["string"],"help":"The name of the tileset to get.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"hasTile","static":false,"returns":{"types":["boolean"],"help":"True if there is a tile at the given location, otherwise false."},"help":"Checks if there is a tile at the given location.","line":1084,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position to check if a tile exists at (given in tile units, not pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position to check if a tile exists at (given in tile units, not pixels)","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to set as current.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"paste","static":false,"returns":null,"help":"Pastes a previously copied block of tile data into the given x\/y coordinates. Data should have been prepared with Tilemap.copy.","line":1443,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the top left of the area to paste to (given in tiles, not pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to paste to (given in tiles, not pixels)","optional":false,"default":null},{"name":"tileblock","type":["array"],"help":"The block of tiles to paste.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to paste the tiles into.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"putTile","static":false,"returns":{"types":["Phaser.Tile"],"help":"The Tile object that was created or added to this map."},"help":"Puts a tile of the given index value at the coordinate specified.\\nIf you pass `null` as the tile it will pass your call over to Tilemap.removeTile instead.","line":1156,"public":true,"protected":false,"private":false,"parameters":[{"name":"tile","type":["Phaser.Tile","number","null"],"help":"The index of this tile to set or a Phaser.Tile object. If null the tile is removed from the map.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position to place the tile (given in tile units, not pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position to place the tile (given in tile units, not pixels)","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to modify.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"putTileWorldXY","static":false,"returns":{"types":["Phaser.Tile"],"help":"The Tile object that was created or added to this map."},"help":"Puts a tile into the Tilemap layer. The coordinates are given in pixel values.","line":1228,"public":true,"protected":false,"private":false,"parameters":[{"name":"tile","type":["Phaser.Tile","number"],"help":"The index of this tile to set or a Phaser.Tile object.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position to insert the tile (given in pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position to insert the tile (given in pixels)","optional":false,"default":null},{"name":"tileWidth","type":["number"],"help":"The width of the tile in pixels.","optional":false,"default":null},{"name":"tileHeight","type":["number"],"help":"The height of the tile in pixels.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to modify.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"random","static":false,"returns":null,"help":"Randomises a set of tiles in a given area.","line":1597,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width in tiles of the area to operate on.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height in tiles of the area to operate on.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"removeAllLayers","static":false,"returns":null,"help":"Removes all layers from this tile map.","line":1710,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"removeTile","static":false,"returns":{"types":["Phaser.Tile"],"help":"The Tile object that was removed from this map."},"help":"Removes the tile located at the given coordinates and updates the collision data.","line":1101,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position to place the tile (given in tile units, not pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position to place the tile (given in tile units, not pixels)","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to modify.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"removeTileWorldXY","static":false,"returns":{"types":["Phaser.Tile"],"help":"The Tile object that was removed from this map."},"help":"Removes the tile located at the given coordinates and updates the collision data. The coordinates are given in pixel values.","line":1134,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position to insert the tile (given in pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position to insert the tile (given in pixels)","optional":false,"default":null},{"name":"tileWidth","type":["number"],"help":"The width of the tile in pixels.","optional":false,"default":null},{"name":"tileHeight","type":["number"],"help":"The height of the tile in pixels.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to modify.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"replace","static":false,"returns":null,"help":"Scans the given area for tiles with an index matching `source` and updates their index to match `dest`.","line":1564,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["number"],"help":"The tile index value to scan for.","optional":false,"default":null},{"name":"dest","type":["number"],"help":"The tile index value to replace found tiles with.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width in tiles of the area to operate on.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height in tiles of the area to operate on.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"searchTileIndex","static":false,"returns":{"types":["Phaser.Tile"],"help":"The first (or n skipped) tile with the matching index."},"help":"Searches the entire map layer for the first tile matching the given index, then returns that Phaser.Tile object.\\nIf no match is found it returns null.\\nThe search starts from the top-left tile and continues horizontally until it hits the end of the row, then it drops down to the next column.\\nIf the reverse boolean is true, it scans starting from the bottom-right corner travelling up to the top-left.","line":1252,"public":true,"protected":false,"private":false,"parameters":[{"name":"index","type":["number"],"help":"The tile index value to search for.","optional":false,"default":null},{"name":"skip","type":["number"],"help":"The number of times to skip a matching tile before returning.","optional":true,"default":"0"},{"name":"reverse","type":["number"],"help":"If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left.","optional":true,"default":"false"},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to get the tile from.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setCollision","static":false,"returns":null,"help":"Sets collision the given tile or tiles. You can pass in either a single numeric index or an array of indexes: [ 2, 3, 15, 20].\\nThe `collides` parameter controls if collision will be enabled (true) or disabled (false).","line":690,"public":true,"protected":false,"private":false,"parameters":[{"name":"indexes","type":["number","array"],"help":"Either a single tile index, or an array of tile IDs to be checked for collision.","optional":false,"default":null},{"name":"collides","type":["boolean"],"help":"If true it will enable collision. If false it will clear collision.","optional":true,"default":"true"},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to this.currentLayer.","optional":true,"default":null},{"name":"recalculate","type":["boolean"],"help":"Recalculates the tile faces after the update.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"setCollisionBetween","static":false,"returns":null,"help":"Sets collision on a range of tiles where the tile IDs increment sequentially.\\nCalling this with a start value of 10 and a stop value of 14 would set collision for tiles 10, 11, 12, 13 and 14.\\nThe `collides` parameter controls if collision will be enabled (true) or disabled (false).","line":730,"public":true,"protected":false,"private":false,"parameters":[{"name":"start","type":["number"],"help":"The first index of the tile to be set for collision.","optional":false,"default":null},{"name":"stop","type":["number"],"help":"The last index of the tile to be set for collision.","optional":false,"default":null},{"name":"collides","type":["boolean"],"help":"If true it will enable collision. If false it will clear collision.","optional":true,"default":"true"},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to this.currentLayer.","optional":true,"default":null},{"name":"recalculate","type":["boolean"],"help":"Recalculates the tile faces after the update.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"setCollisionByExclusion","static":false,"returns":null,"help":"Sets collision on all tiles in the given layer, except for the IDs of those in the given array.\\nThe `collides` parameter controls if collision will be enabled (true) or disabled (false).","line":765,"public":true,"protected":false,"private":false,"parameters":[{"name":"indexes","type":["array"],"help":"An array of the tile IDs to not be counted for collision.","optional":false,"default":null},{"name":"collides","type":["boolean"],"help":"If true it will enable collision. If false it will clear collision.","optional":true,"default":"true"},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to this.currentLayer.","optional":true,"default":null},{"name":"recalculate","type":["boolean"],"help":"Recalculates the tile faces after the update.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"setLayer","static":false,"returns":null,"help":"Sets the current layer to the given index.","line":1064,"public":true,"protected":false,"private":false,"parameters":[{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to set as current.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setPreventRecalculate","static":false,"returns":null,"help":"Turn off\/on the recalculation of faces for tile or collission updates.\\nsetPreventRecalculate(true) puts recalculation on hold while\\nsetPreventRecalculate(false) recalculates all the changed layers.","line":894,"public":true,"protected":false,"private":false,"parameters":[{"name":"if","type":["boolean"],"help":" true it will put the recalculation on hold.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setTileIndexCallback","static":false,"returns":null,"help":"Sets a global collision callback for the given tile index within the layer. This will affect all tiles on this layer that have the same index.\\nIf a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.\\nIf you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.","line":628,"public":true,"protected":false,"private":false,"parameters":[{"name":"indexes","type":["number","array"],"help":"Either a single tile index, or an array of tile indexes to have a collision callback set for.","optional":false,"default":null},{"name":"callback","type":["function"],"help":"The callback that will be invoked when the tile is collided with.","optional":false,"default":null},{"name":"callbackContext","type":["object"],"help":"The context under which the callback is called.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to this.currentLayer.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setTileLocationCallback","static":false,"returns":null,"help":"Sets a global collision callback for the given map location within the layer. This will affect all tiles on this layer found in the given area.\\nIf a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.\\nIf you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.","line":662,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the top left of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the area to copy (given in tiles, not pixels)","optional":false,"default":null},{"name":"callback","type":["function"],"help":"The callback that will be invoked when the tile is collided with.","optional":false,"default":null},{"name":"callbackContext","type":["object"],"help":"The context under which the callback is called.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to this.currentLayer.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setTileSize","static":false,"returns":null,"help":"Sets the base tile size for the map.","line":231,"public":true,"protected":false,"private":false,"parameters":[{"name":"tileWidth","type":["number"],"help":"The width of the tiles the map uses for calculations.","optional":false,"default":null},{"name":"tileHeight","type":["number"],"help":"The height of the tiles the map uses for calculations.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"shuffle","static":false,"returns":null,"help":"Shuffles a set of tiles in a given area. It will only randomise the tiles in that area, so if they're all the same nothing will appear to have changed!","line":1642,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width in tiles of the area to operate on.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height in tiles of the area to operate on.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"swap","static":false,"returns":null,"help":"Scans the given area for tiles with an index matching tileA and swaps them with tileB.","line":1481,"public":true,"protected":false,"private":false,"parameters":[{"name":"tileA","type":["number"],"help":"First tile index.","optional":false,"default":null},{"name":"tileB","type":["number"],"help":"Second tile index.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the top left of the area to operate one, given in tiles, not pixels.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width in tiles of the area to operate on.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height in tiles of the area to operate on.","optional":false,"default":null},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"calculateFaces","static":false,"returns":null,"help":"Internal function.","line":915,"public":false,"protected":true,"private":false,"parameters":[{"name":"layer","type":["number"],"help":"The index of the TilemapLayer to operate on.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getIndex","static":false,"returns":{"types":["number"],"help":"The index of the element in the array, or null if not found."},"help":"Gets the layer index based on the layers name.","line":551,"public":false,"protected":true,"private":false,"parameters":[{"name":"location","type":["array"],"help":"The local array to search.","optional":false,"default":null},{"name":"name","type":["string"],"help":"The name of the array element to get.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getLayer","static":false,"returns":{"types":["number"],"help":"The TilemapLayer index."},"help":"Gets the TilemapLayer index as used in the setCollision calls.","line":863,"public":false,"protected":true,"private":false,"parameters":[{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"The layer to operate on. If not given will default to this.currentLayer.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setCollisionByIndex","static":false,"returns":null,"help":"Sets collision values on a tile in the set.\\nYou shouldn't usually call this method directly, instead use setCollision, setCollisionBetween or setCollisionByExclusion.","line":800,"public":false,"protected":true,"private":false,"parameters":[{"name":"index","type":["number"],"help":"The index of the tile on the layer.","optional":false,"default":null},{"name":"collides","type":["boolean"],"help":"If true it will enable collision on the tile. If false it will clear collision values from the tile.","optional":true,"default":"true"},{"name":"layer","type":["number"],"help":"The layer to operate on. If not given will default to this.currentLayer.","optional":true,"default":null},{"name":"recalculate","type":["boolean"],"help":"Recalculates the tile faces after the update.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""}],"private":[{"name":"swapHandler","static":false,"returns":null,"help":"Internal function that handles the swapping of tiles.","line":1508,"public":false,"protected":false,"private":true,"parameters":[{"name":"value","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[{"name":"collideIndexes","type":["array"],"help":"","inlineHelp":"An array of tile indexes that collide.","line":117,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"collision","type":["array"],"help":"","inlineHelp":"An array of collision data (polylines, etc).","line":122,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"currentLayer","type":["number"],"help":"","inlineHelp":"The current layer.","line":132,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"debugMap","type":["array"],"help":"","inlineHelp":"Map data used for debug values only.","line":137,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"format","type":["number"],"help":"","inlineHelp":"The format of the map data, either Phaser.Tilemap.CSV or Phaser.Tilemap.TILED_JSON.","line":72,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running Game.","line":30,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"height","type":["number"],"help":"","inlineHelp":"The height of the map (in tiles).","line":52,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"heightInPixels","type":["number"],"help":"","inlineHelp":"The height of the map in pixels based on height * tileHeight.","line":92,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"images","type":["array"],"help":"","inlineHelp":"An array of Tiled Image Layers.","line":127,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"key","type":["string"],"help":"","inlineHelp":"The key of this map data in the Phaser.Cache.","line":35,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"layer","type":["number","string","Phaser.TilemapLayer"],"help":"","inlineHelp":"The current layer object.","line":1780,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"layers","type":["array"],"help":"","inlineHelp":"An array of Tilemap layer data.","line":97,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"objects","type":["array"],"help":"","inlineHelp":"An array of Tiled Object Layers.","line":112,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"orientation","type":["string"],"help":"","inlineHelp":"The orientation of the map data (as specified in Tiled), usually 'orthogonal'.","line":67,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"properties","type":["object"],"help":"","inlineHelp":"Map specific properties as specified in Tiled.","line":82,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"tileHeight","type":["number"],"help":"","inlineHelp":"The base height of the tiles in the map (in pixels).","line":62,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"tileWidth","type":["number"],"help":"","inlineHelp":"The base width of the tiles in the map (in pixels).","line":57,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"tiles","type":["array"],"help":"","inlineHelp":"The super array of Tiles.","line":107,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"tilesets","type":["array"],"help":"","inlineHelp":"An array of Tilesets.","line":102,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"version","type":["number"],"help":"","inlineHelp":"The version of the map data (as specified in Tiled, usually 1).","line":77,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"width","type":["number"],"help":"","inlineHelp":"The width of the map (in tiles).","line":47,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"widthInPixels","type":["number"],"help":"","inlineHelp":"The width of the map in pixels based on width * tileWidth.","line":87,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_results","type":["array"],"help":"","inlineHelp":"Internal var.","line":143,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_tempA","type":["number"],"help":"","inlineHelp":"Internal var.","line":149,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_tempB","type":["number"],"help":"","inlineHelp":"Internal var.","line":155,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}}