Class: Window

DKTools.Window

new DKTools.Window ()

Extends

  • Window_Base

Mixes In

Classes

Scrollable
Selectable

Members

_contentsSprite DKTools.Sprite | * privatereadonly

bitmap Bitmap | null

Bitmap of the contents sprite To support functions from DKTools.Base

Methods

_createContentsBackSprite () private

Creates the contents background sprite

_createContentsSprite () private

Creates the contents sprite

activate ()

Activates the window

clear ()Boolean

Clears the window Returns true if successfully completed
Returns:
Type Description
Boolean Successfully completed

contentsHeight ()Number

Returns the height of the contents
Returns:
Type Description
Number Height of the contents

contentsWidth ()Number

Returns the width of the contents
Returns:
Type Description
Number Width of the contents

createAll ()

Creates all objects

createContents ()

Creates the contents

deactivate ()

Deactivates the window

drawText (text, options)

Draws the text Returns true if successfully completed
Name Type Default Description
text String Text
options Object {} optional Options for drawing

drawTextEx (text, options)

Draws the text
Name Type Default Description
text String Text
options Object {} optional Options for drawing
Version:
  • 1.1.0

hideBack ()

Hides the background

hideContentsBack ()

Hides the contents background

hideCursor ()

Hides the cursor

hideFrame ()

Hides the frame

initialize (object, y, width, height)

Initializes a window
Name Type Description
object Number | Graphics | Object optional The X coordinate or Graphics or object with parameters
y Number optional The Y coordinate (if object is Number)
width Number optional Width of the window (if object is Number)
height Number | String optional Height of the window or number of lines (String) (if object is Number)
object.x Number optional The X coordinate
object.y Number optional The Y coordinate
object.width Number optional Width of the window
object.height Number | String optional Height of the window or number of lines (String)
Examples
const window = new DKTools.Window(0, 0, 100, 100);
const window = new DKTools.Window(Graphics);
const window = new DKTools.Window({ x: 0, y: 0, width: 200, height: 200 });
const window = new DKTools.Window(50, 50, 400, '2');

isOpenAndActive ()Boolean

Returns true if the window is open and active
Returns:
Type Description
Boolean Window is open and active

isOpenAndVisible ()Boolean

Returns true if the window is open and visible
Returns:
Type Description
Boolean Window is open and visible

loadWindowskin ()

Loads the window skin

onItemChange (item, lastItem)

Handles item change
Name Type Description
item * Item
lastItem * Last item

refreshAll ()

Updates and redraws all

resetFontSettings ()

Resets the font settings

resetPaintOpacity ()

Resets the paint opacity of the bitmap
Since:
  • 1.1.5

resetTextColor ()

Resets the text color

resize (width, height, blockStart)Boolean

Changes the size of the window Returns true if the change occurred
Name Type Default Description
width Number Width of the window
height Number | String Height of the window or number of lines (String)
blockStart Boolean false optional Blocking the call of the "start" function
Returns:
Type Description
Boolean Change occurred

setupAll (object)

Sets all parameters
Name Type Default Description
object Object {} optional Parameters
Name Type Description
contentsWidth function | Number optional Width of the contents
contentsHeight function | Number optional Height of the contents
contentsSprite Sprite optional Contents sprite
Version:
  • 1.1.0

setupContentsHeight (contentsHeight)

Sets the height of the contents
Name Type Default Description
contentsHeight function | Number this.standardContentsHeight() optional Height of the contents

setupContentsSprite (contentsSprite)

Sets the sprite of the contents
Name Type Default Description
contentsSprite DKTools.Sprite | * this.standardContentsSprite() optional Contents sprite

setupContentsWidth (contentsWidth)

Sets the width of the contents
Name Type Default Description
contentsWidth function | Number this.standardContentsWidth() optional Width of the contents

setupSize (width, height)

Sets the size of the window
Name Type Description
width Number | Object optional Width of the window
height Number | String optional Height of the window or number of lines (String)
Version:
  • 1.1.0

standardContentsSprite ()DKTools.Sprite | Sprite

Returns the standard sprite of the contents
Returns:
Type Description
DKTools.Sprite | Sprite Standard sprite of the contents

standardOpennessSpeed ()Number

Returns the standard openness speed of the window
Returns:
Type Description
Number Standard openness speed of the window

standardPadding ()Number

Just for compatibility with MV plugins Returns the window padding
Since:
  • 1.2.4
Returns:
Type Description
Number Window padding

update ()

Updates the window

updateAll ()

Updates all

updateClose ()

Updates the closing of the window
Version:
  • 1.1.5

updateCloseEvents ()

Updates the events with type: close

updateContents ()

Updates the contents

updateOpen ()

Updates the opening of the window
Version:
  • 1.1.5

updateOpenEvents ()

Updates the events with type: open