Familiar territory. Window keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.
The window in the game.
function Window()
Quick Reference
Setup & Creation 12
| initialize() | Sets up a new instance. |
| _createAllParts() | Creates the all parts. |
| _createContainer() | Creates the container. |
| _createBackSprite() | Creates the back sprite. |
| _createFrameSprite() | Creates the frame sprite. |
| _createClientArea() | Creates the client area. |
| _createContentsBackSprite() | Creates the contents back sprite. |
| _createCursorSprite() | Creates the cursor sprite. |
| _createContentsSprite() | Creates the contents sprite. |
| _createArrowSprites() | Creates the arrow sprites. |
| _createPauseSignSprites() | Creates the pause sign sprites. |
| _makeCursorAlpha() | Makes the cursor alpha. |
Checks (True / False) 2
| isOpen() | Checks whether the window is completely open (openness == 255). |
| isClosed() | Checks whether the window is completely closed (openness == 0). |
Actions 9
| destroy() | Destroys the window. |
| move() | Sets the x, y, width, and height all at once. |
| setCursorRect() | Sets the position of the command cursor. |
| moveCursorBy() | Moves the cursor position by the given amount. |
| moveInnerChildrenBy() | Moves the inner children by the given amount. |
| setTone() | Changes the color of the background. |
| addChildToBack() | Adds a child between the background and contents. |
| addInnerChild() | Adds a child to the client area. |
| _setRectPartsGeometry() | dm: the corners' size on screen when it differs from their m in the skin. |
Events, Commands & Input 1
| _onWindowskinLoad() | Called when windowskin load happens. |
Updating & Drawing 19
| update() | Updates the window for each frame. |
| updateTransform() | Updates the transform on all children of this container for rendering. |
| _updateClipMask() | Clip mask over the visible client rect, rebuilt only when that rect changes. |
| drawShape() | Draws the window shape into PIXI.Graphics object. |
| _refreshAllParts() | Redraws the all parts. |
| _refreshBack() | Redraws the back. |
| _refreshFrame() | Redraws the frame. |
| _refreshRgssFrame() | RGSS frames (System.json rrRgssFrames: the skins an import kept the frame cell of, as <skin>_frame.png): the… |
| _refreshCursor() | Redraws the cursor. |
| _refreshArrows() | Redraws the arrows. |
| _refreshPauseSign() | Redraws the pause sign. |
| _updateClientArea() | Updates the client area each frame. |
| _updateFrame() | Updates the frame each frame. |
| _updateContentsBack() | Updates the contents back each frame. |
| _updateCursor() | Updates the cursor each frame. |
| _updateContents() | Updates the contents each frame. |
| _updateArrows() | Updates the arrows each frame. |
| _updatePauseSign() | Updates the pause sign each frame. |
| _updateFilterArea() | Updates the filter area each frame. |
Other 3
| defaultMargin() | System.json advanced.windowMargin (a 2003 window has none); 4 when the data is not loaded. |
| _clampedCursorRect() | The cursor is clamped to the window's inner rect (MV behavior). |
| _localizeFilterArea() | Restates the client area's filter rectangle in the coordinates v8 expects. |
Setup & Creation
initialize
method sourceWindow.prototype.initialize()
Sets up a new instance. (Same as the RPG Maker MZ method of this name.)
_createAllParts
method internal sourceWindow.prototype._createAllParts()
Creates the all parts. (Same as the RPG Maker MZ method of this name.)
_createContainer
method internal sourceWindow.prototype._createContainer()
Creates the container. (Same as the RPG Maker MZ method of this name.)
_createBackSprite
method internal sourceWindow.prototype._createBackSprite()
Creates the back sprite. (Same as the RPG Maker MZ method of this name.)
_createFrameSprite
method internal sourceWindow.prototype._createFrameSprite()
Creates the frame sprite. (Same as the RPG Maker MZ method of this name.)
_createClientArea
method internal sourceWindow.prototype._createClientArea()
Creates the client area. (Same as the RPG Maker MZ method of this name.)
_createContentsBackSprite
method internal sourceWindow.prototype._createContentsBackSprite()
Creates the contents back sprite. (Same as the RPG Maker MZ method of this name.)
_createCursorSprite
method internal sourceWindow.prototype._createCursorSprite()
Creates the cursor sprite. (Same as the RPG Maker MZ method of this name.)
_createContentsSprite
method internal sourceWindow.prototype._createContentsSprite()
Creates the contents sprite. (Same as the RPG Maker MZ method of this name.)
_createArrowSprites
method internal sourceWindow.prototype._createArrowSprites()
Creates the arrow sprites. (Same as the RPG Maker MZ method of this name.)
_createPauseSignSprites
method internal sourceWindow.prototype._createPauseSignSprites()
Creates the pause sign sprites. (Same as the RPG Maker MZ method of this name.)
_makeCursorAlpha
method internal sourceWindow.prototype._makeCursorAlpha()
Makes the cursor alpha. (Same as the RPG Maker MZ method of this name.)
Checks (True / False)
isOpen
method sourceWindow.prototype.isOpen()
Checks whether the window is completely open (openness == 255).
Details
Checks whether the window is completely open (openness == 255).
isClosed
method sourceWindow.prototype.isClosed()
Checks whether the window is completely closed (openness == 0).
Details
Checks whether the window is completely closed (openness == 0).
Actions
destroy
method sourceWindow.prototype.destroy()
Destroys the window.
move
method sourceWindow.prototype.move(x, y, width, height)
Sets the x, y, width, and height all at once.
Details
Sets the x, y, width, and height all at once.
setCursorRect
method sourceWindow.prototype.setCursorRect(x, y, width, height)
Sets the position of the command cursor.
Details
Sets the position of the command cursor.
moveCursorBy
method sourceWindow.prototype.moveCursorBy(x, y)
Moves the cursor position by the given amount.
Details
Moves the cursor position by the given amount.
moveInnerChildrenBy
method sourceWindow.prototype.moveInnerChildrenBy(x, y)
Moves the inner children by the given amount.
Details
Moves the inner children by the given amount.
setTone
method sourceWindow.prototype.setTone(r, g, b)
Changes the color of the background.
Details
Changes the color of the background.
addChildToBack
method sourceWindow.prototype.addChildToBack(child)
Adds a child between the background and contents.
Details
Adds a child between the background and contents.
addInnerChild
method sourceWindow.prototype.addInnerChild(child)
Adds a child to the client area.
Details
Adds a child to the client area.
_setRectPartsGeometry
method internal sourceWindow.prototype._setRectPartsGeometry(sprite, srect, drect, m, dm = m)
dm: the corners' size on screen when it differs from their m in the skin.
Events, Commands & Input
_onWindowskinLoad
method internal sourceWindow.prototype._onWindowskinLoad()
Called when windowskin load happens. (Same as the RPG Maker MZ method of this name.)
Updating & Drawing
update
method sourceWindow.prototype.update()
Updates the window for each frame.
updateTransform
method sourceWindow.prototype.updateTransform()
Updates the transform on all children of this container for rendering.
_updateClipMask
method internal sourceWindow.prototype._updateClipMask()
Clip mask over the visible client rect, rebuilt only when that rect changes.
drawShape
method sourceWindow.prototype.drawShape(graphics)
Draws the window shape into PIXI.Graphics object.
Details
Draws the window shape into PIXI.Graphics object. Used by WindowLayer.
_refreshAllParts
method internal sourceWindow.prototype._refreshAllParts()
Redraws the all parts. (Same as the RPG Maker MZ method of this name.)
_refreshBack
method internal sourceWindow.prototype._refreshBack()
Redraws the back. (Same as the RPG Maker MZ method of this name.)
_refreshFrame
method internal sourceWindow.prototype._refreshFrame()
Redraws the frame. (Same as the RPG Maker MZ method of this name.)
_refreshRgssFrame
method internal sourceWindow.prototype._refreshRgssFrame()
RGSS frames (System.json rrRgssFrames: the skins an import kept the frame cell of, as <skin>_frame.png): the 16 px corners as they are and the edges repeated along the sides every 32 px, where MZ's frame stretches them (a skin with ornaments along its edges smears into streaks).
Details
RGSS frames (System.json rrRgssFrames: the skins an import kept the frame cell of, as <skin>_frame.png): the 16 px corners as they are and the edges repeated along the sides every 32 px, where MZ's frame stretches them (a skin with ornaments along its edges smears into streaks). True when it drew one.
_refreshCursor
method internal sourceWindow.prototype._refreshCursor()
Redraws the cursor. (Same as the RPG Maker MZ method of this name.)
_refreshArrows
method internal sourceWindow.prototype._refreshArrows()
Redraws the arrows. (Same as the RPG Maker MZ method of this name.)
_refreshPauseSign
method internal sourceWindow.prototype._refreshPauseSign()
Redraws the pause sign. (Same as the RPG Maker MZ method of this name.)
_updateClientArea
method internal sourceWindow.prototype._updateClientArea()
Updates the client area each frame. (Same as the RPG Maker MZ method of this name.)
_updateFrame
method internal sourceWindow.prototype._updateFrame()
Updates the frame each frame. (Same as the RPG Maker MZ method of this name.)
_updateContentsBack
method internal sourceWindow.prototype._updateContentsBack()
Updates the contents back each frame. (Same as the RPG Maker MZ method of this name.)
_updateCursor
method internal sourceWindow.prototype._updateCursor()
Updates the cursor each frame. (Same as the RPG Maker MZ method of this name.)
_updateContents
method internal sourceWindow.prototype._updateContents()
Updates the contents each frame. (Same as the RPG Maker MZ method of this name.)
_updateArrows
method internal sourceWindow.prototype._updateArrows()
Updates the arrows each frame. (Same as the RPG Maker MZ method of this name.)
_updatePauseSign
method internal sourceWindow.prototype._updatePauseSign()
Updates the pause sign each frame. (Same as the RPG Maker MZ method of this name.)
_updateFilterArea
method internal sourceWindow.prototype._updateFilterArea()
Updates the filter area each frame. (Same as the RPG Maker MZ method of this name.)
Other
defaultMargin
static sourceWindow.defaultMargin()
System.json advanced.windowMargin (a 2003 window has none); 4 when the data is not loaded.
_clampedCursorRect
method internal sourceWindow.prototype._clampedCursorRect()
The cursor is clamped to the window's inner rect (MV behavior).
Details
The cursor is clamped to the window's inner rect (MV behavior). Plugins set cursor rects that extend past the window — e.g. VE_BattleCommandWindow offsets the selected item's rect for its slide effect — and rely on the window clipping the highlight instead of letting it bleed outside.
_localizeFilterArea
method internal sourceWindow.prototype._localizeFilterArea()
Restates the client area's filter rectangle in the coordinates v8 expects.
Details
Restates the client area's filter rectangle in the coordinates v8 expects.
v8's FilterSystem._calculateFilterArea does
bounds.addRect(filterEffect.filterArea);
bounds.applyMatrix(container.worldTransform);
so it reads filterArea as container-LOCAL and applies the world transform itself. Handed the world-space rect that v5/v6/v7 wanted, it transforms it a second time and the captured region lands roughly twice as far down the screen as the window — off the edge entirely for a window past the middle. The filter then resolves to nothing, and everything inside the client area silently disappears: the panel and its border still draw (they are not in the client area), so a window renders as an empty box.
Correcting it here rather than in _updateFilterArea above is the point. A window's filter rect is computed by whichever _updateFilterArea is installed last, and plugins that reimplement scrolling or window drawing routinely install their own — VisuMZ's CoreEngine among them. Those all write the world-space rect the engine documented, cannot know about v8, and cannot be edited. Removing the client area's world origin and scale afterwards fixes every one of them, including our own, with no version branch above.
Position staleness cancels because both methods read the same transform. A plugin can instead scale dimensions from this.scale, so on the first frame its size can be divided by a still-identity world transform; the next frame is correct. Guessing which convention wrote a rectangle is less reliable.