Class: Scene

DKTools.Scene

new DKTools.Scene ()

Extends

Classes

Preloader

Members

_eventsManager DKTools.EventsManager privatereadonly

Methods

activate () inherited

Activates the scene
Since:
  • 8.0.0

addAnimation (animation)

Adds the animation
Name Type Description
animation DKTools.Animation Animation to add
Since:
  • 2.0.0

addEvent (object)DKTools.Event

Adds the event
Name Type Description
object DKTools.Event | Object Event or object with parameters for the event
Name Type Description
type String optional Type of the event
repeatTime Number optional Time of one repeat
repeats Number optional Amount of repeats
remainingPauseTime Number optional Remaining time of pause
onStart function optional Handler of the event start
onUpdate function optional Handler of the event update
onPause function optional Handler of the event pause
onReset function optional Handler of the event reset
onRepeat function optional Handler of the event repeat
onSuccess function optional Handler of the event success
onFail function optional Handler of the event fail
Since:
  • 2.0.0
Returns:
Type Description
DKTools.Event Added event

addOneTimeEvent (object)DKTools.Event

Adds the one time event
Name Type Description
object DKTools.Event | Object Event or object with parameters for the event
Name Type Description
type String optional Type of the event
remainingPauseTime Number optional Remaining time of pause
onStart function optional Handler of the event start
onUpdate function optional Handler of the event update
onPause function optional Handler of the event pause
onReset function optional Handler of the event reset
onRepeat function optional Handler of the event repeat
onSuccess function optional Handler of the event success
onFail function optional Handler of the event fail
Since:
  • 2.0.0
Returns:
Type Description
DKTools.Event Added event

calcWindowHeight (numLines, selectable)Number

Returns calculated window height
Name Type Default Description
numLines Number 1 optional Window lines
selectable Boolean false optional Selectable window
Since:
  • 11.1.0
Returns:
Type Description
Number Calculated window height

create ()

Creates all

createAllSprites ()

Creates all sprites

createAllWindows ()

Creates all windows

createBackground ()

Creates the background
Version:
  • 11.1.0

createForeground ()

Creates the foreground

createHelpWindow (windowClass, rows)

Creates the help window
Name Type Default Description
windowClass function Window class
rows Number 2 optional Visible rows
Since:
  • 11.1.0

deactivate () inherited

Deactivates the scene
Since:
  • 8.0.0

hasWindowLayer ()Boolean

Returns true if the scene has the layer of windows
Returns:
Type Description
Boolean Scene has the layer of windows

helpAreaBottom ()Number

Since:
  • 11.1.0
Returns:
Type Description
Number

helpAreaHeight ()Number

Since:
  • 11.1.0
Returns:
Type Description
Number

helpAreaTop ()Number

Since:
  • 11.1.0
Returns:
Type Description
Number

helpWindowRect (rows)Rectangle

Returns the rect of the help window
Name Type Description
rows Number Visible rows
Since:
  • 11.1.0
Returns:
Type Description
Rectangle Rect of the help window

initialize ()

Initializes a class object

isChild (object)Boolean

Returns true if the object (parameter) is child of scene
Name Type Description
object Sprite | Window Object
Returns:
Type Description
Boolean Object (parameter) is child of scene

isPreloaded ()Boolean inherited

Returns true if the scene is preloaded
Since:
  • 6.1.0
Returns:
Type Description
Boolean Scene is preloaded

mainAreaBottom ()Number

Since:
  • 11.1.0
Returns:
Type Description
Number

mainAreaHeight ()Number

Since:
  • 11.1.0
Returns:
Type Description
Number

mainAreaTop ()Number

Since:
  • 11.1.0
Returns:
Type Description
Number

needsBackground ()Boolean

Returns true if needs create the background
Since:
  • 11.1.0
Returns:
Type Description
Boolean Needs create the background

removeWindow (window)Boolean

Removes the window from the scene Returns true if the window is removed
Name Type Description
window DKTools.Window | * Window to remove
Version:
  • 8.3.0
Returns:
Type Description
Boolean Window is removed

setupPreloading () inherited

Setups for the preloading
Since:
  • 6.1.0
Example
var bitmap = ImageManager.loadSystem('Window')

this._preloader.add(bitmap);

startPreloading () inherited

Starts the preloading
Since:
  • 6.1.0

update ()

Updates the scene
Version:
  • 10.0.0

updateEvents ()

Updates the events
Since:
  • 2.0.0

updateQueueEvents ()

Updates the events with type: queue
Version:
  • 8.3.0
Since:
  • 2.0.0

updateReadyEvents ()

Updates the events with type: ready
Version:
  • 8.3.0
Since:
  • 2.0.0

updateUpdateEvents ()

Updates the events with type: update
Version:
  • 8.3.0
Since:
  • 2.0.0