2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module TMXLayer
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @extend SpriteBatchNode
|
|
|
|
-- @parent_module cc
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-23 16:32:54 +08:00
|
|
|
-- Returns the position in points of a given tile coordinate.<br>
|
2015-09-27 23:24:49 +08:00
|
|
|
-- param tileCoordinate The tile coordinate.<br>
|
2015-03-23 16:32:54 +08:00
|
|
|
-- return The position in points of a given tile coordinate.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getPositionAt
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table tileCoordinate
|
2014-05-27 14:31:18 +08:00
|
|
|
-- @return vec2_table#vec2_table ret (return value: vec2_table)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Set layer orientation, which is the same as the map orientation.<br>
|
|
|
|
-- param orientation Layer orientation,which is the same as the map orientation.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setLayerOrientation
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int orientation
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- Dealloc the map that contains the tile position from memory.<br>
|
|
|
|
-- Unless you want to know at runtime the tiles positions, you can safely call this method.<br>
|
|
|
|
-- If you are going to call layer->tileGIDAt() then, don't release the map.
|
|
|
|
-- @function [parent=#TMXLayer] releaseMap
|
|
|
|
-- @param self
|
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-23 16:32:54 +08:00
|
|
|
-- Size of the layer in tiles.<br>
|
|
|
|
-- return Size of the layer in tiles.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getLayerSize
|
|
|
|
-- @param self
|
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Set the size of the map's tile.<br>
|
|
|
|
-- param size The size of the map's tile.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setMapTileSize
|
|
|
|
-- @param self
|
|
|
|
-- @param #size_table size
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-23 16:32:54 +08:00
|
|
|
-- Layer orientation, which is the same as the map orientation.<br>
|
|
|
|
-- return Layer orientation, which is the same as the map orientation.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getLayerOrientation
|
|
|
|
-- @param self
|
|
|
|
-- @return int#int ret (return value: int)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Set an Properties from to layer.<br>
|
|
|
|
-- param properties It is used to set the layer Properties.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setProperties
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #map_table properties
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Set the layer name.<br>
|
|
|
|
-- param layerName The layer name.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setLayerName
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string layerName
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Removes a tile at given tile coordinate. <br>
|
|
|
|
-- param tileCoordinate The tile coordinate.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] removeTileAt
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table tileCoordinate
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Initializes a TMXLayer with a tileset info, a layer info and a map info.<br>
|
|
|
|
-- param tilesetInfo An tileset info.<br>
|
|
|
|
-- param layerInfo A layer info.<br>
|
|
|
|
-- param mapInfo A map info.<br>
|
|
|
|
-- return If initializes successfully, it will return true.
|
|
|
|
-- @function [parent=#TMXLayer] initWithTilesetInfo
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param self
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @param #cc.TMXTilesetInfo tilesetInfo
|
|
|
|
-- @param #cc.TMXLayerInfo layerInfo
|
|
|
|
-- @param #cc.TMXMapInfo mapInfo
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-23 16:32:54 +08:00
|
|
|
-- Creates the tiles.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setupTiles
|
|
|
|
-- @param self
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-07-17 15:46:20 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @overload self, unsigned int, vec2_table, int
|
|
|
|
-- @overload self, unsigned int, vec2_table
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setTileGID
|
|
|
|
-- @param self
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @param #unsigned int gid
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table tileCoordinate
|
|
|
|
-- @param #int flags
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-03-23 16:32:54 +08:00
|
|
|
-- Size of the map's tile (could be different from the tile's size).<br>
|
2015-09-27 23:24:49 +08:00
|
|
|
-- return The size of the map's tile.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getMapTileSize
|
|
|
|
-- @param self
|
|
|
|
-- @return size_table#size_table ret (return value: size_table)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-03-23 16:32:54 +08:00
|
|
|
-- Return the value for the specific property name.<br>
|
2015-09-27 23:24:49 +08:00
|
|
|
-- param propertyName The specific property name.<br>
|
|
|
|
-- return Return the value for the specific property name.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getProperty
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string propertyName
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return Value#Value ret (return value: cc.Value)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Set size of the layer in tiles.<br>
|
|
|
|
-- param size Size of the layer in tiles.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setLayerSize
|
|
|
|
-- @param self
|
|
|
|
-- @param #size_table size
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Get the layer name. <br>
|
|
|
|
-- return The layer name.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getLayerName
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Set tileset information for the layer.<br>
|
|
|
|
-- param info The tileset information for the layer.<br>
|
|
|
|
-- js NA
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] setTileSet
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.TMXTilesetInfo info
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Tileset information for the layer. <br>
|
2015-03-23 16:32:54 +08:00
|
|
|
-- return Tileset information for the layer.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getTileSet
|
|
|
|
-- @param self
|
|
|
|
-- @return TMXTilesetInfo#TMXTilesetInfo ret (return value: cc.TMXTilesetInfo)
|
|
|
|
|
2015-09-27 23:24:49 +08:00
|
|
|
--------------------------------
|
|
|
|
-- @overload self
|
|
|
|
-- @overload self
|
|
|
|
-- @function [parent=#TMXLayer] getProperties
|
|
|
|
-- @param self
|
|
|
|
-- @return map_table#map_table ret (return value: map_table)
|
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2015-03-23 16:32:54 +08:00
|
|
|
-- Returns the tile (Sprite) at a given a tile coordinate.<br>
|
2014-09-02 13:45:07 +08:00
|
|
|
-- The returned Sprite will be already added to the TMXLayer. Don't add it again.<br>
|
|
|
|
-- The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.<br>
|
|
|
|
-- You can remove either by calling:<br>
|
2015-03-23 16:32:54 +08:00
|
|
|
-- - layer->removeChild(sprite, cleanup);<br>
|
2015-09-27 23:24:49 +08:00
|
|
|
-- - or layer->removeTileAt(Vec2(x,y));<br>
|
|
|
|
-- param tileCoordinate A tile coordinate.<br>
|
2015-03-23 16:32:54 +08:00
|
|
|
-- return Returns the tile (Sprite) at a given a tile coordinate.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] getTileAt
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #vec2_table tileCoordinate
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return Sprite#Sprite ret (return value: cc.Sprite)
|
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- Creates a TMXLayer with an tileset info, a layer info and a map info.<br>
|
2015-03-23 16:32:54 +08:00
|
|
|
-- param tilesetInfo An tileset info.<br>
|
|
|
|
-- param layerInfo A layer info.<br>
|
|
|
|
-- param mapInfo A map info.<br>
|
2015-09-27 23:24:49 +08:00
|
|
|
-- return An autorelease object.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] create
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.TMXTilesetInfo tilesetInfo
|
|
|
|
-- @param #cc.TMXLayerInfo layerInfo
|
|
|
|
-- @param #cc.TMXMapInfo mapInfo
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer ret (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-03-18 15:55:30 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @function [parent=#TMXLayer] addChild
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.Node child
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @param #int zOrder
|
|
|
|
-- @param #int tag
|
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2015-09-27 23:24:49 +08:00
|
|
|
-- js NA
|
|
|
|
-- @function [parent=#TMXLayer] getDescription
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @param self
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return string#string ret (return value: string)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @function [parent=#TMXLayer] removeChild
|
2014-03-18 15:55:30 +08:00
|
|
|
-- @param self
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @param #cc.Node child
|
|
|
|
-- @param #bool cleanup
|
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- js ctor
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TMXLayer] TMXLayer
|
|
|
|
-- @param self
|
2015-09-27 23:24:49 +08:00
|
|
|
-- @return TMXLayer#TMXLayer self (return value: cc.TMXLayer)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|