Scaleform Studio Lua API Reference: scaleform.SpriteComponent object reference

scaleform.SpriteComponent object reference

Description

Represents a sprite object.

Functions

Parameters

self :

scaleform.SpriteComponent

The sprite currently in use.

animation :

SpriteAnimation

A frame that describes an animation.

animFlags :

integer

Flags for the animation.

Returns

integer

The animation frame index from one to number of animations.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

integer

The animation flags set for the sprite.

Parameters

owner :

scaleform.Actor

The owner actor of the component.

Returns

scaleform.SpriteComponent

Returns the newly created SpriteComponent.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

integer

The current animation index from 1 to the number of animations.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

integer

The current frame index from 1 to the number of frames.

Parameters

self :

scaleform.SpriteComponent

The sprite to load the sheet for.

sprite_sheet :

scaleform.SpriteSheet

The spritesheet to load.

Returns

integer

The index of the spritesheet loaded from 1 to number of spritesheets.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

boolean

Returns true of the component is set to loop otherwise false.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

integer

The number of time the animation loops.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

integer

The number of loops.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

boolean

Returns true of the component is set to ping pong otherwise false.

Parameters

self :

scaleform.SpriteComponent

The sprite to play.

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite to play.

forward :

boolean

The direction to animate.

loopCount :

integer

Number of loops

Returns
This function does not return any values.

Passing in loopCount = -1 can make the animation loop indefinitely.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

boolean

Returns true of the component is playing otherwise false.

Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

Returns

boolean

Returns true of the component is playing backwards otherwise false.

Parameters

self :

scaleform.SpriteComponent

The sprite currently in use.

index :

integer

Index of the animation to be removed from 1 to number of animations

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

flags :

integer

The animation flags to set.

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

index :

integer

The index of the animation from 1 to the number of animations.

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

index :

integer

The index of the frame from 1 to the number of frames.

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

loopCount :

integer

The maximum number of time for the loop.

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

loopCount :

integer

The number of loops in the animation.

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite currently used.

enable :

boolean

A boolean flag to enable reversal of playing direction.

Returns
This function does not return any values.
Parameters

self :

scaleform.SpriteComponent

The sprite to stop.

Returns
This function does not return any values.
 scaleform.Component
The root type of all actor components.
 scaleform.VisualComponent
An interface to the visual component.
 scaleform.SpriteComponent.create (owner) : scaleform.SpriteComponent
Creates a new sprite component.
 scaleform.SpriteComponent.add_animation (self, animation, animFlags) : integer
Adds a series of frames that describe an animation.
 self : scaleform.SpriteComponent
The sprite currently in use.
 animation : SpriteAnimation
A frame that describes an animation.
 animFlags : integer
Flags for the animation.
 integer  scaleform.SpriteComponent
Represents a sprite object.
 SpriteAnimation

{ frame : integer, frame_time : number, sprite_sheet : integer, }
A strictly integral numeric value, with no decimal component.  scaleform.SpriteComponent.animation_flags (self) : integer
Returns the animation flags set for direct control of animation behavior.
 self : scaleform.SpriteComponent
The sprite currently used.
 integer  owner : scaleform.Actor
The owner actor of the component.
 scaleform.SpriteComponent
Returns the newly created SpriteComponent.
 scaleform.Actor
Generic objects located in a scene.
 scaleform.SpriteComponent.current_animation (self) : integer
Returns the index of the current animation.
 self : scaleform.SpriteComponent
The sprite currently used.
 integer  scaleform.SpriteComponent.current_frame (self) : integer
Returns the index of the current frame in animation.
 self : scaleform.SpriteComponent
The sprite currently used.
 integer  scaleform.SpriteComponent.load_sprite_sheet (self, sprite_sheet) : integer
Creates and loads the sprites based on the sprite sheet description.
 self : scaleform.SpriteComponent
The sprite to load the sheet for.
 sprite_sheet : scaleform.SpriteSheet
The spritesheet to load.
 integer
The index of the spritesheet loaded from 1 to number of spritesheets.
 scaleform.SpriteSheet

{ frames : scaleform.SpriteFrame[], ImgFilePath : string, num_frames : integer, }
 scaleform.SpriteComponent.looping (self) : boolean
Determines if the frame is looping one or not.
 self : scaleform.SpriteComponent
The sprite currently used.
 booleantrue or false.  scaleform.SpriteComponent.max_loops (self) : integer
Returns the maximum amount of time the animation loops.
 self : scaleform.SpriteComponent
The sprite currently used.
 integer  scaleform.SpriteComponent.num_loops (self) : integer
Returns the loop count of the animation.
 self : scaleform.SpriteComponent
The sprite currently used.
 integer  scaleform.SpriteComponent.ping_pong (self) : boolean
Determines whether the ping pong flag for reversing the playing direction of animation is enabled or not.
 self : scaleform.SpriteComponent
The sprite currently used.
 boolean  scaleform.SpriteComponent.play (self)
Starts animating.
 self : scaleform.SpriteComponent
The sprite to play.
 scaleform.SpriteComponent.play (self, forward, loopCount)
Starts animating, either forward or backward.
 self : scaleform.SpriteComponent
The sprite to play.
 forward : boolean
The direction to animate.
 loopCount : integer
Number of loops
 scaleform.SpriteComponent.playing (self) : boolean
Determines whether the animation is playing.
 self : scaleform.SpriteComponent
The sprite currently used.
 boolean  scaleform.SpriteComponent.playing_backwards (self) : boolean
Determines if the animation is playing backwards or not.
 self : scaleform.SpriteComponent
The sprite currently used.
 boolean  scaleform.SpriteComponent.remove_animation_by_index (self, index)
Removes the set of frames that describe an animation.
 self : scaleform.SpriteComponent
The sprite currently in use.
 index : integer
Index of the animation to be removed from 1 to number of animations
 scaleform.SpriteComponent.set_animation_flags (self, flags)
Sets the animation flags that allow direct control of animation behavior.
 self : scaleform.SpriteComponent
The sprite currently used.
 flags : integer
The animation flags to set.
 scaleform.SpriteComponent.set_current_animation (self, index)
Sets the index of the current animation.
 self : scaleform.SpriteComponent
The sprite currently used.
 index : integer
The index of the animation from 1 to the number of animations.
 scaleform.SpriteComponent.set_current_frame (self, index)
Sets the index of the current frame.
 self : scaleform.SpriteComponent
The sprite currently used.
 index : integer
The index of the frame from 1 to the number of frames.
 scaleform.SpriteComponent.set_max_loops (self, loopCount)
Sets the maximum amount of time the animation loops.
 self : scaleform.SpriteComponent
The sprite currently used.
 loopCount : integer
The maximum number of time for the loop.
 scaleform.SpriteComponent.set_num_loops (self, loopCount)
Sets the loop count of the animation.
 self : scaleform.SpriteComponent
The sprite currently used.
 loopCount : integer
The number of loops in the animation.
 scaleform.SpriteComponent.set_ping_pong (self, enable)
Sets the ping-pong flag which makes the animation loop by reversing the playing direction when the last or first frame is reached.
 self : scaleform.SpriteComponent
The sprite currently used.
 enable : boolean
A boolean flag to enable reversal of playing direction.
 scaleform.SpriteComponent.stop (self)
Stops playing the animation.
 self : scaleform.SpriteComponent
The sprite to stop.
A numeric value.  scaleform.SpriteFrame

{ anchor : integer[], bounds : scaleform.Rect, }
A string of characters.  scaleform.Rect
A rectangle based upon two points.
{ x1 : number, x2 : number, y1 : number, y2 : number, }
Indicates a table.
This documentation uses the term table to mean an anonymous, temporary Lua table that contains named data values. You typically use these tables to pass data or settings to a function, or to hold data returned by a function.
Indicates an object.
This documentation uses the term object to mean a named Lua table or userdata value that maintains a state. Some object types may have multiple instances existing at the same time, each with its own state; these objects typically have creation functions or accessors that you must call in order to get an instance. Some object types have only one instance, which you always access through the object's name.
Indicates a named variable within a namespace, object or table; or an element within an enumeration.Indicates a code sample.Indicates an enumeration.
This documentation uses the term enumeration to mean a named Lua table that contains only a set of constant values. These values typically identify a predefined set of options for some setting or behavior. You might pass an enumeration value to a function, or test the value returned by a function against the items in the enumeration to see which option is currently set.
Indicates a named variable within a namespace or object that has a pre-set constant value.Indicates a category: a semantic grouping of related API elements.Indicates a namespace.
This documentation uses the term namespace to mean a named Lua table that exists in only one single instance, intended as a container for an interface of related objects, functions and data variables.
Indicates an output value returned by a function.Indicates a named function within a namespace or object.Indicates an input parameter for a function.