Subframe object

The Subframe object allows you to access the properties of the animation subframes. Subframe objects can be queried using the Frame.GetSubframe and Frame.Addsubframe methods. Also if there is only one subframe assigned to an animation frame all these methods and attributes apply directly to the frame.


Методы

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.

Атрибуты

Type (только для чтения) Returns always "subframe"
AlphaColor Specifies an RGBA color of this subframe.
TransparentColor (только для чтения) Returns the transparent color of this subframe.
Is2DOnly Specifies if this frame is only displayed when the game is running in non-accelerated mode.
Is3DOnly Specifies if this frame is only displayed when the game is running in accelerated mode.
Decoration Specifies if this is the decoration subrame (i.e. it's not active under mouse cursor)
HotspotX The X coordinate of the hotspot (the point the sprite is painted from)
HotspotY The Y coordinate of the hotspot (the point the sprite is painted from)

GetSound()

Returns the sound assigned to this frame.

Возвращаемое значение

The filename of the assigned sound or null.


SetSound(Filename)

Assigns a sound to this frame.

Параметры

Filename
The filename of the sound to be assigned.

Возвращаемое значение

If the method succeeds, the return value is true.


GetSubframe(Index)

Returns a subframe of this frame.

Параметры

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

Возвращаемое значение

If the method succeeds it returns a subframe object.


AddSubframe(Filename)

Adds a new subframe to this animation frame.

Параметры

Filename
An image file to be used for this subframe.

Возвращаемое значение

Returns the newly created subframe object.


InsertSubframe(Index, Filename)

Inserts a new subframe to this animation frame.

Параметры

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

Возвращаемое значение

Returns the newly created subframe object.


Deletesubframe(Index)
Deletesubframe(Subframe)

Removes specified subframe from this animation frame.

Параметры

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.

Параметры

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

Возвращаемое значение

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


AddEvent(EventName)

Adds an event to this frame.

Параметры

EventName
A name of the event to be added.

DeleteEvent(EventName)

Removes an event from this frame.

Параметры

EventName
A name of the event to be removed.