Frame object

The Frame object allows you to access the properties of your animation frame. Frame objects can be queried using the Sprite.GetFrame and Sprite.AddFrame methods.

Note: If there is only one subframe, all the subframe methods and attributes also apply to a frame object.


Methods

Actions
GetSound Returns the sound assigned to this frame.
SetSound Assigns a sound to this frame.
GetSubframe Returns a subframe of this frame.
AddSubframe Adds a new subframe to this animation frame.
InsertSubframe Inserts a new subframe to this animation frame.
Deletesubframe Removes specified subframe from this animation frame.
GetEvent Returns an event assigned to this frame.
AddEvent Adds an event to this frame.
DeleteEvent Removes an event from this frame.

Attributes

Type (read only) Returns always "frame"
Delay The delay of this frame (in milliseconds)
Keyframe Specifies if this frame is a keyframe (not used).
KillSounds Specifies if this frame should stop all currently playing sounds started by this sprite.
MoveX Specifies the X movement applied to the owner object by this frame.
MoveY Specifies the Y movement applied to the owner object by this frame.
NumSubframes (read only) Returns the actual number of subframes if this frame.
NumEvents (read only) Returns the number of events assigned to this frame.

GetSound()

Returns the sound assigned to this frame.

Return value

The filename of the assigned sound or null.


SetSound(Filename)

Assigns a sound to this frame.

Parameters

Filename
The filename of the sound to be assigned.

Return value

If the method succeeds, the return value is true.


GetSubframe(Index)

Returns a subframe of this frame.

Parameters

Index
A zero-based index of the subframe to be returned.

Return value

If the method succeeds it returns a subframe object.


AddSubframe(Filename)

Adds a new subframe to this animation frame.

Parameters

Filename
An image file to be used for this subframe.

Return value

Returns the newly created subframe object.


InsertSubframe(Index, Filename)

Inserts a new subframe to this animation frame.

Parameters

Index
The position where the new subframe should be inserted.
Filename
An image file to be used for this subframe.

Return value

Returns the newly created subframe object.


Deletesubframe(Index)
Deletesubframe(Subframe)

Removes specified subframe from this animation frame.

Parameters

Index
A zero-based index of a subframe to be removed.
Subframe
The subframe object to be removed.

GetEvent(Index)

Returns an event assigned to this frame.

Parameters

Index
A zero-based index of an event to be returned.

Return value

If the method succeeds it returns a name of the event.


AddEvent(EventName)

Adds an event to this frame.

Parameters

EventName
A name of the event to be added.

DeleteEvent(EventName)

Removes an event from this frame.

Parameters

EventName
A name of the event to be removed.