Class: Event

DKTools.Event

Event class

new DKTools.Event (object)

Name Type Description
object Object optional Parameters
Name Type Description
target DKTools.Sprite | DKTools.Window | * optional Target of the event
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

Members

_id Number | String | * privatereadonly

_manager DKTools.EventsManager privatereadonly

_onFail function | null privatereadonly

_onPause function | null privatereadonly

_onRepeat function | null privatereadonly

_onReset function | null privatereadonly

_onStart function | null privatereadonly

_onSuccess function | null privatereadonly

_onUpdate function | null privatereadonly

_remainingPauseTime Number privatereadonly

_remainingRepeats Number privatereadonly

_remainingTime Number privatereadonly

_repeats Number privatereadonly

_repeatTime Number privatereadonly

_started Boolean privatereadonly

_target DKTools.Sprite | DKTools.Window | * privatereadonly

_type String privatereadonly

id

Gets id of the event
Since:
  • 6.0.0

manager

Gets manager of the event

remainingPauseTime

Gets remaining time of pause

remainingPauseTime

Sets remaining time of pause

remainingRepeats

Remaining amount of repeats

remainingRepeats

Sets remaining amount of repeats

remainingTime

Gets remaining time of current repeat

remainingTime

Sets remaining time of current repeat

repeats

Gets amount of repeats

repeatTime

Gets time of one repeat

target

Gets target of the event

type

Gets type of the event

Methods

_callOnFailHandler (data) private

Calls on failure handler
Name Type Description
data * optional Data
Version:
  • 10.0.5

_callOnPauseHandler (data) private

Calls on pause handler
Name Type Description
data * optional Data
Version:
  • 10.0.5

_callOnRepeatHandler (data) private

Calls on repeat handler
Name Type Description
data * optional Data
Version:
  • 10.0.5

_callOnResetHandler (data) private

Calls on reset handler
Name Type Description
data * optional Data
Version:
  • 10.0.5

_callOnStartHandler (data) private

Calls on start handler
Name Type Description
data * optional Data
Version:
  • 10.0.5

_callOnSuccessHandler (forcedSuccess, data) private

Calls on success handler
Name Type Default Description
forcedSuccess Boolean false optional
data * optional Data
Version:
  • 10.0.5

_callOnUpdateHandler (data) private

Calls on update handler
Name Type Description
data * optional Data

_canCallOnFailHandler ()Boolean private

Returns true if can call on failure handler
Returns:
Type Description
Boolean Can call on failure handler

_canCallOnPauseHandler ()Boolean private

Returns true if can call on pause handler
Returns:
Type Description
Boolean Can call on pause handler

_canCallOnRepeatHandler ()Boolean private

Returns true if can call on repeat handler
Returns:
Type Description
Boolean Can call on repeat handler

_canCallOnResetHandler ()Boolean private

Returns true if can call on reset handler
Returns:
Type Description
Boolean Can call on reset handler

_canCallOnStartHandler ()Boolean private

Returns true if can call on start handler
Returns:
Type Description
Boolean Can call on start handler

_canCallOnSuccessHandler ()Boolean private

Returns true if can call on success handler
Returns:
Type Description
Boolean Can call on success handler

_canCallOnUpdateHandler ()Boolean private

Returns true if can call on update handler
Returns:
Type Description
Boolean Can call on update handler

_clearRemainingRepeats () private

Clears the remaining time of the event repeat

_clearRemainingTime () private

Clears the remaining time of the event repeat

_resetRemainingRepeats () private

Resets the remaining amount of repeats of the event

_resetRemainingTime () private

Resets the remaining time of the event repeat

_update (data) private

Updates the event
Name Type Description
data * optional Data

_updatePause () private

Updates the pause

_updateRemainingPauseTime () private

Updates the remaining pause time

_updateRemainingRepeats () private

Updates the remaining repeats

_updateRemainingTime () private

Updates the remaining time

fail (data)

Fails the events
Name Type Description
data * optional Data
Since:
  • 10.0.5

finish (forcedSuccess, data)

Finishes the event
Name Type Default Description
forcedSuccess Boolean false optional Forced successful completion of the event
data * optional Data
Version:
  • 10.0.5

getElapsedRepeats ()Number

Returns the elapsed repeats
Returns:
Type Description
Number Elapsed repeats

getElapsedTime ()Number

Returns the elapsed time
Returns:
Type Description
Number Elapsed time

hasManager ()Boolean

Returns true if the event has the manager
Since:
  • 5.0.0
Returns:
Type Description
Boolean Event has the manager

hasOnFailHandler ()Boolean

Returns true if the event has the on failure handler
Returns:
Type Description
Boolean Event has the on failure handler

hasOnPauseHandler ()Boolean

Returns true if the event has the on pause handler
Returns:
Type Description
Boolean Event has the on pause handler

hasOnRepeatHandler ()Boolean

Returns true if the event has the on repeat handler
Returns:
Type Description
Boolean Event has the on repeat handler

hasOnResetHandler ()Boolean

Returns true if the event has the on reset handler
Returns:
Type Description
Boolean Event has the on reset handler

hasOnStartHandler ()Boolean

Returns true if the event has the on start handler
Returns:
Type Description
Boolean Event has the on start handler

hasOnSuccessHandler ()Boolean

Returns true if the event has the on success handler
Returns:
Type Description
Boolean Event has the on success handler

hasOnUpdateHandler ()Boolean

Returns true if the event has the on update handler
Returns:
Type Description
Boolean Event has the on update handler

hasTarget ()Boolean

Returns true if the event has the target
Returns:
Type Description
Boolean Event has the target

hasType ()Boolean

Returns true if the event has the type
Returns:
Type Description
Boolean Event has the type

initialize (object)

Initializes the event
Name Type Description
object Object optional Parameters
Name Type Description
id Number | String optional ID of the event
target DKTools.Sprite | DKTools.Window | * optional Target of the event
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
Version:
  • 6.0.0

isAnimation ()Boolean

Returns true if the event is animation
Returns:
Type Description
Boolean Event is animation

isAnimationAction ()Boolean

Returns true if the event is action of an animation
Returns:
Type Description
Boolean Event is action of an animation

isFinished ()Boolean

Returns true if the event if finished
Returns:
Type Description
Boolean Event if finished

isPaused ()Boolean

Returns true if the event is paused
Returns:
Type Description
Boolean Event is paused

isStarted ()Boolean

Returns true if the event is started
Returns:
Type Description
Boolean Event is started

isUpdated ()Boolean

Returns true if the event is updated
Returns:
Type Description
Boolean Event is updated

pause (duration)

Pauses the event
Name Type Default Description
duration Number -1 optional Duration of pause

remove ()Boolean

Removes the event Returns true if the event was removed
Version:
  • 8.0.0
Returns:
Type Description
Boolean Event was removed

repeat ()

Repeats the event

reset ()

Resets the event
Version:
  • 1.1.0

resume ()

Resumes the event

setManager (manager)

Sets the manager
Name Type Description
manager DKTools.EventsManager Manager
Since:
  • 5.0.0

setOnFailHandler (handler)

Sets the on failure handler
Name Type Description
handler function Handler

setOnPauseHandler (handler)

Sets the on pause handler
Name Type Description
handler function Handler

setOnRepeatHandler (handler)

Sets the on repeat handler
Name Type Description
handler function Handler

setOnResetHandler (handler)

Sets the on reset handler
Name Type Description
handler function Handler

setOnStartHandler (handler)

Sets the on start handler
Name Type Description
handler function Handler

setOnSuccessHandler (handler)

Sets the on success handler
Name Type Description
handler function Handler

setOnUpdateHandler (handler)

Sets the on update handler
Name Type Description
handler function Handler

setTarget (target)

Sets the target
Name Type Description
target DKTools.Sprite | DKTools.Window | * Target

stop (forcedSuccess)

Stops the event
Name Type Default Description
forcedSuccess Boolean false optional Forced successful completion of the event

update (data)

Updates the event
Name Type Description
data * optional Data