mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 19:43:28 +00:00
1 line
46 KiB
JSON
1 line
46 KiB
JSON
|
{"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 t
|