Classes
Global | Description |
---|---|
Tilemap ⇐ PIXI.Container |
Functions
Global | Description |
---|---|
addChild(child) ⇒ Object | 向容器添加子对象。 Adds a child to the container. |
addChildAt(child, index) ⇒ Object | 在指定索引位置向容器添加子对象。 Adds a child to the container at a specified index. |
removeChild(child) ⇒ Object | 从容器中移除子对象。 Removes a child from the container. |
removeChildAt(index) ⇒ Object | 从指定索引位置移除子对象。 Removes a child from the specified index position. |
initialize() | 初始化瓦片地图。 Initializes the tilemap. |
setData(width, height, data) | 设置瓦片地图数据。 Sets the tilemap data. |
isReady() ⇒ Boolean | 检查瓦片集是否已准备好渲染。 Checks whether the tileset is ready to render. |
update() | 为每一帧更新瓦片地图。 Updates the tilemap for each frame. |
refresh() | 强制重绘整个瓦片地图。 Forces to repaint the entire tilemap. |
refreshTileset() | 强制刷新瓦片集。 Forces to refresh the tileset. |
Tilemap ⇐ PIXI.Container
Kind: global class
Extends: PIXI.Container
new Tilemap()
显示 2D 瓦片游戏地图的瓦片地图。
The tilemap which displays 2D tile-based game map.
addChild(child) ⇒ Object
向容器添加子对象。
Adds a child to the container.
Kind: global function
Returns: Object
- 添加的子对象 The child that was added
Param | Type | Description |
---|---|---|
child | Object | 要添加的子对象 The child to add |
addChildAt(child, index) ⇒ Object
在指定索引位置向容器添加子对象。
Adds a child to the container at a specified index.
Kind: global function
Returns: Object
- 添加的子对象 The child that was added
Param | Type | Description |
---|---|---|
child | Object | 要添加的子对象 The child to add |
index | Number | 放置子对象的索引 The index to place the child in |
removeChild(child) ⇒ Object
从容器中移除子对象。
Removes a child from the container.
Kind: global function
Returns: Object
- 被移除的子对象 The child that was removed
Param | Type | Description |
---|---|---|
child | Object | 要移除的子对象 The child to remove |
removeChildAt(index) ⇒ Object
从指定索引位置移除子对象。
Removes a child from the specified index position.
Kind: global function
Returns: Object
- 被移除的子对象 The child that was removed
Param | Type | Description |
---|---|---|
index | Number | 获取子对象的索引 The index to get the child from |
initialize()
初始化瓦片地图。
Initializes the tilemap.
Kind: global function
setData(width, height, data)
设置瓦片地图数据。
Sets the tilemap data.
Kind: global function
Param | Type | Description |
---|---|---|
width | Number | 地图宽度(瓦片数量) The width of the map in number of tiles |
height | Number | 地图高度(瓦片数量) The height of the map in number of tiles |
data | Array | 地图数据的一维数组 The one dimensional array for the map data |
isReady() ⇒ Boolean
检查瓦片集是否已准备好渲染。
Checks whether the tileset is ready to render.
Kind: global function
Returns: Boolean
- 如果瓦片地图准备就绪则为 true True if the tilemap is ready
update()
为每一帧更新瓦片地图。
Updates the tilemap for each frame.
Kind: global function
refresh()
强制重绘整个瓦片地图。
Forces to repaint the entire tilemap.
Kind: global function
refreshTileset()
强制刷新瓦片集。
Forces to refresh the tileset.
Kind: global function