Class: Window_Base

(abstract) Window_Base(x, y, width, height)

(abstract) new Window_Base(x, y, width, height)

Parameters:
Name Type Description
x Number
y Number
width Number
height Number

Extends

Methods

activate()

Activates the window, allowing it to be processed and to update.

actorName(actorIndex) → {String}

Returns the actor name given an index; the index starts from 1.
Parameters:
Name Type Description
actorIndex Number
Returns:
Type
String

addChild(child) → {Object}

[super] Adds a child to the container.
Parameters:
Name Type Description
child Object The child to add
Inherited From:
Returns:
The child that was added
Type
Object

addChildAt(child, index) → {Object}

[super] Adds a child to the container at a specified index.
Parameters:
Name Type Description
child Object The child to add
index Number The index to place the child in
Inherited From:
Returns:
The child that was added
Type
Object

addChildToBack(child) → {Object}

Adds a child between the background and contents.
Parameters:
Name Type Description
child Object The child to add
Inherited From:
Returns:
The child that was added
Type
Object

calcTextHeight(textState, all) → {Number}

Calculates the text height of the textState (when using drawTextEx); if all is set to true, all lines of text are calculated, otherwise only a single line is processed.
Parameters:
Name Type Description
textState MV.TextState
all Boolean
Returns:
Type
Number

canvasToLocalX(x) → {Number}

Returns the x coordinate of the mouse to a local window x coordinate.
Parameters:
Name Type Description
x Number
Returns:
Type
Number

canvasToLocalY(y) → {Number}

Returns the y coordinate of the mouse to a local window y coordinate.
Parameters:
Name Type Description
y Number
Returns:
Type
Number

changePaintOpacity(enabled)

Changes the paintOpacity (the opacity of the text drawn to the window); if true the opacity is set to 255, otherwise the opacity is set to 160.
Parameters:
Name Type Description
enabled Boolean

changeTextColor(color)

Changes the text color property given a css color string.
Parameters:
Name Type Description
color String

close()

Closes the window.

contentsHeight() → {Number}

Returns the inner content height of the window.
Returns:
Type
Number

contentsWidth() → {Number}

Returns the inner content width of the window.
Returns:
Type
Number

convertEscapeCharacters(text) → {String}

Converts the escape characters and returns the text content after processing the characters.
Parameters:
Name Type Description
text String
Returns:
Type
String

createContents()

Creates the contents of the window; this is the area of the window which text is drawn to.

crisisColor() → {String}

Returns the crisis color as a css color string.
Returns:
Type
String

deactivate()

Deactives the window, preventing further processing.

deathColor() → {String}

Returns the death color as a css color string.
Returns:
Type
String

dimColor1() → {String}

Color 1 of the dimmer sprite bitmap. for the gradient.
Returns:
Type
String

dimColor2() → {String}

Color 2 of the dimmer sprite bitmap for the gradient.
Returns:
Type
String

drawActorCharacter(actor, x, y)

Parameters:
Name Type Description
actor Game_Actor
x Number
y Number

drawActorClass(actor, x, y, width)

Draws the actor class at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawActorFace(actor, x, y, width, height)

Draws the actor face at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number
height Number

drawActorHp(actor, x, y, width)

Draws the actor hp at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawActorIcons(actor, x, y, width)

Draws the actor icons at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawActorLevel(actor, x, y)

Draws the actor level at the specified x and y coordinates.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number

drawActorMp(actor, x, y, width)

Draws the actor mp at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawActorName(actor, x, y, width)

Draws the actor name at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawActorNickname(actor, x, y, width)

Draws the actor nickname at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawActorSimpleStatus(actor, x, y, width)

Draws a simple status for the game actor passed into the method at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawActorTp(actor, x, y, width)

Draws the actor tp at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
actor Game_Actor
x Number
y Number
width Number

drawCharacter(characterName, characterIndex, x, y)

Draws a character (map sprites) at the specified x and y coordinate. CharacterName refers to character spritesheet, and characterIndex refers to the characterIndex on the spritesheet.
Parameters:
Name Type Description
characterName String
characterIndex Number
x Number
y Number

drawCurrencyValue(value, unit, x, y, width)

Draws the currency value given at the specified x and y coordinates within the width given. Useful if you want to write your own custom currency value.
Parameters:
Name Type Description
value Number
unit String
x Number
y Number
width Number

drawCurrentAndMax(current, max, x, y, width, color1, color2)

Draws the current and max number at the specified x and y coordinate within the given width. Color1 represents the current number and color2 represents the max number when the text is drawn.
Parameters:
Name Type Description
current Number
max Number
x Number
y Number
width Number
color1 String
color2 String

drawFace(faceName, faceIndex, x, y, width, height)

Parameters:
Name Type Description
faceName String
faceIndex Number
x Number
y Number
width Number
height Number

drawGauge(x, y, width, rate, color1, color2)

Draws a gauge at the specified x and y coordinates within the given width. Color1 and Color2 represent the gradient as css color strings of the gauge.
Parameters:
Name Type Description
x Number
y Number
width Number
rate Number
color1 String
color2 String

drawIcon(iconIndex, x, y)

Draws an icon given the specified iconIndex at the specified x and y coordinates. The Width and Height of the icon is based on the _iconWidth and _iconHeight properties.
Parameters:
Name Type Description
iconIndex Number
x Number
y Number

drawItemName(item, x, y, width)

Draws the item name at the specified x and y coordinates within the given width.
Parameters:
Name Type Description
item RPG.BaseItem
x Number
y Number
width Number

drawText(text, x, y, maxWidth, align)

Given text or a number, draws the content to the window's contents layer at the specified x and y coordinate within the max width. The text content can also be aligned with the align property. The possible alignments are: "left", "center", "right".
Parameters:
Name Type Description
text string | number
x Number
y Number
maxWidth Number
align String

drawTextEx(text, x, y) → {Number}

Draws text with text codes included; this will draw icons, increase text height, and more.
Parameters:
Name Type Description
text String
x Number
y Number
Returns:
Type
Number

fittingHeight(numLines) → {Number}

Returns the fitting height given a number of lines based on the line height plus standard padding of the window. Default formula: numLines * lineHeight + standardPadding * 2
Parameters:
Name Type Description
numLines Number
Returns:
Type
Number

gaugeBackColor() → {String}

Returns the gauage back color as a css color string.
Returns:
Type
String

hide()

Hides the window, making it invisible; the window is not closed when hidden.

hideBackgroundDimmer()

Hides the background dimmer sprite.

hpColor(actor) → {String}

Returns the hp color as a css string.
Parameters:
Name Type Description
actor Game_Actor
Returns:
Type
String

hpGaugeColor1() → {String}

Returns the hp gauge color 1 as a css color string.
Returns:
Type
String

hpGaugeColor2() → {String}

Returns the hp gauge color 2 as a css color string.
Returns:
Type
String

initialize(x, y, width, height)

Creates an instance of Window_Base.
Parameters:
Name Type Description
x Number
y Number
width Number
height Number
Overrides:

isClosed()

Returns true if the window is completely closed (openness == 0).
Inherited From:

isClosing() → {Boolean}

Returns true if the window is currently closing.
Returns:
Type
Boolean

isOpen()

Returns true if the window is completely open (openness == 255).
Inherited From:

isOpening() → {Boolean}

Returns true if the window is currently opening.
Returns:
Type
Boolean

lineHeight() → {Number}

Returns the standard line height of the current window; default is 36.
Returns:
Type
Number

loadWindowskin()

Loads the window skin from the img/system directory.

makeFontBigger()

Makes the font bigger by a value of 12.

makeFontSmaller()

Makes the font smaller by a value of 12.

move(x, y, width, height)

Sets the x, y, width, and height all at once.
Parameters:
Name Type Description
x Number The x coordinate of the window
y Number The y coordinate of the window
width Number The width of the window
height Number The height of the window
Inherited From:

mpColor(actor) → {String}

Returns the mp color as a css color string.
Parameters:
Name Type Description
actor Game_Actor
Returns:
Type
String

mpCostColor() → {String}

Returns the mp cost color as a css color string.
Returns:
Type
String

mpGaugeColor1() → {String}

Returns the mp gauge color 1 as a css color string.
Returns:
Type
String

mpGaugeColor2() → {String}

Returns the mp gauge color 2 as a css color string.
Returns:
Type
String

normalColor() → {String}

Returns the normal color as a css color string.
Returns:
Type
String

obtainEscapeCode(textState)

Parameters:
Name Type Description
textState MV.TextState

obtainEscapeParam(textState) → {number|string}

Obtains the escape parameters from text codes in the text state when drawTextEx is used to draw text.
Parameters:
Name Type Description
textState MV.TextState
Returns:
Type
number | string

open()

Opens the window.

paramchangeTextColor(change)

Changes the text color based on the powerUpColor, powerDownColor and normal color. powerUpColor is any number greater than 0, powerDownColor is any color less than 0, otherwise normal color is returned.
Parameters:
Name Type Description
change Number

partyMemberName(partyMemberIndex) → {String}

Returns a party member name given an index; the index starts from 1.
Parameters:
Name Type Description
partyMemberIndex Number
Returns:
Type
String

pendingColor() → {String}

Returns the pending color as a css color string.
Returns:
Type
String

powerDownColor() → {String}

Returns the power down color as a css color string.
Returns:
Type
String

powerUpColor() → {String}

Returns the power up color as a css color string.
Returns:
Type
String

processCharacter(textState)

Process each character in the text when drawTextEx is used to draw text.
Parameters:
Name Type Description
textState MV.TextState

processDrawIcon(iconIndex, textState)

Processes drawing an icon when drawTextEx is used for drawing text.
Parameters:
Name Type Description
iconIndex Number
textState MV.TextState

processEscapeCharacter(code, textState)

Processes escape characters when drawTextEx is used for drawing text.
Parameters:
Name Type Description
code String
textState MV.TextState

processNewLine(textState)

Processes new line when drawTextEx is used to draw text.
Parameters:
Name Type Description
textState MV.TextState

processNewPage(textState)

Processes new page when drawTexttEx is used to draw text.
Parameters:
Name Type Description
textState MV.TextState

processNormalCharacter(textState)

Processes the normal characters in the text when drawTextEx is used to draw text. Normal characters are letters and numbers.
Parameters:
Name Type Description
textState MV.TextState

refreshDimmerBitmap()

Refreshes the bitmap attached to the dimmer sprite based on the window dimensions.

removeChild(child) → {Object}

[super] Removes a child to the container.
Parameters:
Name Type Description
child Object The child to remove
Inherited From:
Returns:
The child that was removed
Type
Object

removeChildAt(index) → {Object}

[super] Removes a child from the specified index position.
Parameters:
Name Type Description
index Number The index to get the child from
Inherited From:
Returns:
The child that was removed
Type
Object

reserveFaceImages()

Reverses the face images of the game party members.

resetFontSettings()

Resets the font settings of the window back to the default.

resetTextColor()

Resets the text color of the window back to the default.

setBackgroundType(type)

Sets the background type of the window. 0 is 255 window opacity (standard). 1 is the window with background dimmer. Any other number changes the opacity to 0.
Parameters:
Name Type Description
type Number

setCursorRect(x, y, width, height)

Sets the position of the command cursor.
Parameters:
Name Type Description
x Number The x coordinate of the cursor
y Number The y coordinate of the cursor
width Number The width of the cursor
height Number The height of the cursor
Inherited From:

setTone(r, g, b)

Changes the color of the background.
Parameters:
Name Type Description
r Number The red value in the range (-255, 255)
g Number The green value in the range (-255, 255)
b Number The blue value in the range (-255, 255)
Inherited From:

show()

Shows the window, making it visible.

showBackgroundDimmer()

Shows the background dimmer sprite.

standardBackOpacity() → {Number}

Returns the standard back opacity of the window; this is the opacity of the area behind the window's text content. Default is 192.
Returns:
Type
Number

standardFontFace() → {String}

Returns the standard font face of the game based on what language the game is in.
Returns:
Type
String

standardFontSize() → {Number}

Returns the standard font size of the text in window; default is 28.
Returns:
Type
Number

standardPadding() → {Number}

Returns the standard padding of the window; default is 18.
Returns:
Type
Number

systemColor() → {String}

Returns the system color as a css color string.
Returns:
Type
String

textColor(n) → {*}

Returns a text color given a numbered index as a css color string; this index maps directly to the img/system/window.png colors by default.
Parameters:
Name Type Description
n Number
Returns:
Type
*

textPadding() → {Number}

Returns the text padding of the window; default is 6.
Returns:
Type
Number

textWidth(text) → {Number}

Calculates the width of a text string and returns a number.
Parameters:
Name Type Description
text String
Returns:
Type
Number

tpColor(actor) → {String}

Returns the tp color as a css color string.
Parameters:
Name Type Description
actor Game_Actor
Returns:
Type
String

tpCostColor() → {String}

Returns the tp cost color as a css color string.
Returns:
Type
String

tpGaugeColor1() → {String}

Returns the tp gauge color 1 as a css color string.
Returns:
Type
String

tpGaugeColor2() → {String}

Returns tp gauge color 2 as a css color string.
Returns:
Type
String

translucentOpacity() → {Number}

Returns the translucentOpacity for the window; The default is 160.
Returns:
Type
Number

update()

The update method of the window; this is run every frame to do logic processing for the window.
Overrides:

updateBackgroundDimmer()

Updates the background dimmer sprite opacity based on the openness of the window.

updateBackOpacity() → {Number}

Returns the inner content width of the window.
Returns:
Type
Number

updateClose()

Updates the openness of the window when the _closing property is set to true. Openness is decreased.

updateOpen()

Updates the openness of the window when the _opening property is set to true. Openness is increased.

updatePadding()

Updates the window padding based on the standardPadding method.

updateTone()

Updates the tone of the window based on the game system window tone defined in the database.