Classes
Global | Description |
---|---|
Sprite ⇐ PIXI.Sprite |
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(bitmap) | 初始化精灵。 Initializes the sprite. |
update() | 为每一帧更新精灵。 Updates the sprite for each frame. |
move(x, y) | 一次设置x和y坐标。 Sets the x and y at once. |
setFrame(x, y, width, height) | 设置精灵显示的位图矩形。 Sets the rectangle of the bitmap that the sprite displays. |
getBlendColor() ⇒ Array | 获取精灵的混合颜色。 Gets the blend color for the sprite. |
setBlendColor(color) | 设置精灵的混合颜色。 Sets the blend color for the sprite. |
getColorTone() ⇒ Array | 获取精灵的颜色色调。 Gets the color tone for the sprite. |
setColorTone(tone) | 设置精灵的颜色色调。 Sets the color tone for the sprite. |
Sprite ⇐ PIXI.Sprite
Kind: global class
Extends: PIXI.Sprite
- Sprite ⇐
PIXI.Sprite
- new Sprite(bitmap)
- .voidFilter :
PIXI.filters.VoidFilter
new Sprite(bitmap)
渲染到游戏屏幕的基本对象。
The basic object that is rendered to the game screen.
Param | Type | Description |
---|---|---|
bitmap | Bitmap | 精灵的图像 The image for the sprite |
Sprite.voidFilter : PIXI.filters.VoidFilter
空滤镜实例。
Void filter instance.
Kind: static property of Sprite
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(bitmap)
初始化精灵。
Initializes the sprite.
Kind: global function
Param | Type | Description |
---|---|---|
bitmap | Bitmap | 精灵的图像 The image for the sprite |
update()
为每一帧更新精灵。
Updates the sprite for each frame.
Kind: global function
move(x, y)
一次设置 x 和 y 坐标。
Sets the x and y at once.
Kind: global function
Param | Type | Description |
---|---|---|
x | Number | 精灵的 x 坐标 The x coordinate of the sprite |
y | Number | 精灵的 y 坐标 The y coordinate of the sprite |
setFrame(x, y, width, height)
设置精灵显示的位图矩形。
Sets the rectangle of the bitmap that the sprite displays.
Kind: global function
Param | Type | Description |
---|---|---|
x | Number | 帧的 x 坐标 The x coordinate of the frame |
y | Number | 帧的 y 坐标 The y coordinate of the frame |
width | Number | 帧的宽度 The width of the frame |
height | Number | 帧的高度 The height of the frame |
getBlendColor() ⇒ Array
获取精灵的混合颜色。
Gets the blend color for the sprite.
Kind: global function
Returns: Array
- 混合颜色 [r, g, b, a] The blend color [r, g, b, a]
setBlendColor(color)
设置精灵的混合颜色。
Sets the blend color for the sprite.
Kind: global function
Param | Type | Description |
---|---|---|
color | Array | 混合颜色 [r, g, b, a] The blend color [r, g, b, a] |
getColorTone() ⇒ Array
获取精灵的颜色色调。
Gets the color tone for the sprite.
Kind: global function
Returns: Array
- 颜色色调 [r, g, b, gray] The color tone [r, g, b, gray]
setColorTone(tone)
设置精灵的颜色色调。
Sets the color tone for the sprite.
Kind: global function
Param | Type | Description |
---|---|---|
tone | Array | 颜色色调 [r, g, b, gray] The color tone [r, g, b, gray] |