Skip to content

API / EventObject

Class: EventObject

Defined in: event/EventObject.ts:38

The properties of the object carry basic information about an event, which are passed as parameter or parameter's parameter to event listeners when an event occurs.

Extends

Constructors

Constructor

ts
new EventObject(): EventObject;

Returns

EventObject

Inherited from

BaseObject.constructor

Properties

animationState

ts
animationState: AnimationState;

Defined in: event/EventObject.ts:199

The animation state that dispatch the event.


armature

ts
armature: Armature;

Defined in: event/EventObject.ts:172

The armature that dispatch the event.


bone

ts
bone: Bone;

Defined in: event/EventObject.ts:181

The bone that dispatch the event.


data

ts
data: UserData;

Defined in: event/EventObject.ts:215

The custom data.


hashCode

ts
readonly hashCode: number;

Defined in: core/BaseObject.ts:156

A unique identification number assigned to the object.

Inherited from

BaseObject.hashCode


name

ts
name: string;

Defined in: event/EventObject.ts:163

The event name. (The frame event name or the frame sound name)


slot

ts
slot: Slot;

Defined in: event/EventObject.ts:190

The slot that dispatch the event.


time

ts
time: number;

Defined in: event/EventObject.ts:147

If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds)


type

ts
type: EventStringType;

Defined in: event/EventObject.ts:155

The event type。


COMPLETE

ts
readonly static COMPLETE: "complete" = "complete";

Defined in: event/EventObject.ts:62

Animation play complete.


FADE_IN

ts
readonly static FADE_IN: "fadeIn" = "fadeIn";

Defined in: event/EventObject.ts:70

Animation fade in start.


FADE_IN_COMPLETE

ts
readonly static FADE_IN_COMPLETE: "fadeInComplete" = "fadeInComplete";

Defined in: event/EventObject.ts:78

Animation fade in complete.


FADE_OUT

ts
readonly static FADE_OUT: "fadeOut" = "fadeOut";

Defined in: event/EventObject.ts:86

Animation fade out start.


FADE_OUT_COMPLETE

ts
readonly static FADE_OUT_COMPLETE: "fadeOutComplete" = "fadeOutComplete";

Defined in: event/EventObject.ts:94

Animation fade out complete.


FRAME_EVENT

ts
readonly static FRAME_EVENT: "frameEvent" = "frameEvent";

Defined in: event/EventObject.ts:102

Animation frame event.


LOOP_COMPLETE

ts
readonly static LOOP_COMPLETE: "loopComplete" = "loopComplete";

Defined in: event/EventObject.ts:54

Animation loop play complete once.


SOUND_EVENT

ts
readonly static SOUND_EVENT: "soundEvent" = "soundEvent";

Defined in: event/EventObject.ts:110

Animation frame sound event.


START

ts
readonly static START: "start" = "start";

Defined in: event/EventObject.ts:46

Animation start play.

Methods

returnToPool()

ts
returnToPool(): void;

Defined in: core/BaseObject.ts:167

Clear the object and return it back to object pool。

Returns

void

Inherited from

BaseObject.returnToPool


borrowObject()

ts
static borrowObject<T>(objectConstructor: () => T): T;

Defined in: core/BaseObject.ts:136

Get an instance of the specify class from object pool.

Type Parameters

Type Parameter
T extends BaseObject

Parameters

ParameterTypeDescription
objectConstructor() => TThe specify class.

Returns

T

Inherited from

BaseObject.borrowObject


clearPool()

ts
static clearPool(objectConstructor: typeof BaseObject): void;

Defined in: core/BaseObject.ts:111

Clear the cached instances of a specify object pool.

Parameters

ParameterTypeDefault valueDescription
objectConstructortypeof BaseObjectnullSpecify class. (Clear all cached instances if not set)

Returns

void

Inherited from

BaseObject.clearPool


setMaxCount()

ts
static setMaxCount(objectConstructor: typeof BaseObject, maxCount: number): void;

Defined in: core/BaseObject.ts:72

Set the maximum cache count of the specify object pool.

Parameters

ParameterTypeDescription
objectConstructortypeof BaseObjectThe specify class. (Set all object pools max cache count if not set)
maxCountnumberMax count.

Returns

void

Inherited from

BaseObject.setMaxCount


toString()

ts
static toString(): string;

Defined in: event/EventObject.ts:137

Returns

string

Overrides

BaseObject.toString

Released under the MIT License.