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. |
Window ⇐ PIXI.Container
Kind: global class
Extends: PIXI.Container
- Window ⇐
PIXI.Container- new Window()
- .this.origin
- .this.active
- .this.downArrowVisible
- .this.upArrowVisible
- .this.pause
- .initialize() ⇒
void - .update() ⇒
void - .move(x, y, width, height) ⇒
void - .isOpen() ⇒
Boolean - .isClosed() ⇒
Boolean - .setCursorRect(x, y, width, height) ⇒
void - .setTone(r, g, b) ⇒
void - .addChildToBack(child) ⇒
Object
new Window()
游戏窗口类,提供基本的窗口 UI 功能,包括背景、边框、光标等。
Game window class providing basic window UI functionality including background, frame, cursor, etc.
Window.this.origin
窗口内容滚动的原点坐标。
The origin coordinates for window content scrolling.
Kind: static property of Window
Properties
| Name | Type | Description |
|---|---|---|
| origin | Point | 窗口滚动的原点 The origin point of the window for scrolling |
Window.this.active
窗口是否处于激活状态,影响光标闪烁等交互效果。
Whether the window is in active state, affecting interactions like cursor blinking.
Kind: static property of Window
Properties
| Name | Type | Description |
|---|---|---|
| active | Boolean | 窗口的激活状态 The active state for the window |
Window.this.downArrowVisible
控制向下滚动箭头是否可见。
Controls whether the downward scroll arrow is visible.
Kind: static property of Window
Properties
| Name | Type | Description |
|---|---|---|
| downArrowVisible | Boolean | 下滚动箭头的可见性 The visibility of the down scroll arrow |
Window.this.upArrowVisible
控制向上滚动箭头是否可见。
Controls whether the upward scroll arrow is visible.
Kind: static property of Window
Properties
| Name | Type | Description |
|---|---|---|
| upArrowVisible | Boolean | 上滚动箭头的可见性 The visibility of the up scroll arrow |
Window.this.pause
控制暂停标志是否可见。
Controls whether the pause sign is visible.
Kind: static property of Window
Properties
| Name | Type | Description |
|---|---|---|
| pause | Boolean | 暂停标志的可见性 The visibility of the pause sign |
Window.initialize() ⇒ void
初始化窗口对象,创建所有窗口部件并设置默认属性。
Initializes the window object, creates all window parts and sets default properties.
Kind: static method of Window
Returns: void - 无返回值 No return value
Window.update() ⇒ void
每帧更新窗口状态,包括动画计数和子对象更新。
Updates the window state each frame, including animation count and child object updates.
Kind: static method of Window
Returns: void - 无返回值 No return value
Window.move(x, y, width, height) ⇒ void
同时设置窗口的位置和大小,如果尺寸变化会刷新所有部件。
Sets the position and size of the window at once, refreshes all parts if size changes.
Kind: static method of Window
Returns: void - 无返回值 No return value
| 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 |
Window.isOpen() ⇒ Boolean
检查窗口是否完全打开。
Checks whether the window is completely open.
Kind: static method of Window
Returns: Boolean - 如果窗口完全打开则返回 true True if the window is completely open
Window.isClosed() ⇒ Boolean
检查窗口是否完全关闭。
Checks whether the window is completely closed.
Kind: static method of Window
Returns: Boolean - 如果窗口完全关闭则返回 true True if the window is completely closed
Window.setCursorRect(x, y, width, height) ⇒ void
设置窗口内命令光标的位置和大小。
Sets the position and size of the command cursor within the window.
Kind: static method of Window
Returns: void - 无返回值 No return value
| 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 |
Window.setTone(r, g, b) ⇒ void
改变窗口背景的色调。
Changes the color tone of the window background.
Kind: static method of Window
Returns: void - 无返回值 No return value
| 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) |
Window.addChildToBack(child) ⇒ Object
在窗口背景和内容之间添加子对象。
Adds a child object between the window background and contents.
Kind: static method of Window
Returns: Object - 被添加的子对象 The child that was added
| Param | Type | Description |
|---|---|---|
| child | Object | 要添加的子对象 The child to add |
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 |