Classes
Global | Description |
---|---|
Window ⇐ 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. |
update() | 每帧更新窗口。 Updates the window for each frame. |
move(x, y, width, height) | 同时设置 x、y、宽度和高度。 Sets the x, y, width, and height all at once. |
isOpen() | 如果窗口完全打开则返回true (openness == 255)。 Returns true if the window is completely open (openness == 255). |
isClosed() | 如果窗口完全关闭则返回true (openness == 0)。 Returns true if the window is completely closed (openness == 0). |
setCursorRect(x, y, width, height) | 设置命令光标的位置。 Sets the position of the command cursor. |
setTone(r, g, b) | 改变背景的颜色。 Changes the color of the background. |
addChildToBack(child) ⇒ Object | 在背景和内容之间添加子对象。 Adds a child between the background and contents. |
Window ⇐ PIXI.Container
Kind: global class
Extends: PIXI.Container
new Window()
游戏中的窗口。
The window in the game.
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 |
update()
每帧更新窗口。
Updates the window for each frame.
Kind: global function
move(x, y, width, height)
同时设置 x、y、宽度和高度。
Sets the x, y, width, and height all at once.
Kind: global function
Param | Type | Description |
---|---|---|
x | Number | 窗口的 x 坐标 The x coordinate of the window |
y | Number | 窗口的 y 坐标 The y coordinate of the window |
width | Number | 窗口的宽度 The width of the window |
height | Number | 窗口的高度 The height of the window |
isOpen()
如果窗口完全打开则返回 true (openness == 255)。
Returns true if the window is completely open (openness == 255).
Kind: global function
isClosed()
如果窗口完全关闭则返回 true (openness == 0)。
Returns true if the window is completely closed (openness == 0).
Kind: global function
setCursorRect(x, y, width, height)
设置命令光标的位置。
Sets the position of the command cursor.
Kind: global function
Param | Type | Description |
---|---|---|
x | Number | 光标的 x 坐标 The x coordinate of the cursor |
y | Number | 光标的 y 坐标 The y coordinate of the cursor |
width | Number | 光标的宽度 The width of the cursor |
height | Number | 光标的高度 The height of the cursor |
setTone(r, g, b)
改变背景的颜色。
Changes the color of the background.
Kind: global function
Param | Type | Description |
---|---|---|
r | Number | 红色值,范围 (-255, 255) The red value in the range (-255, 255) |
g | Number | 绿色值,范围 (-255, 255) The green value in the range (-255, 255) |
b | Number | 蓝色值,范围 (-255, 255) The blue value in the range (-255, 255) |
addChildToBack(child) ⇒ Object
在背景和内容之间添加子对象。
Adds a child between the background and contents.
Kind: global function
Returns: Object
- 被添加的子对象 The child that was added
Param | Type | Description |
---|---|---|
child | Object | 要添加的子对象 The child to add |