UpdateSpriteState

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with '{{VideoMethod | video.updateSpriteState(spriteId, timeStep) | This method updates a sprite state's animation. | {{MethodParam|spriteId|An integer|The ID value of the sprite that ...')
 
Line 8: Line 8:
{{MethodParam|timeStep|A number|The time step measured in seconds. For example, if the time step is 60 milliseconds, the value passed should be 0.060.}}
{{MethodParam|timeStep|A number|The time step measured in seconds. For example, if the time step is 60 milliseconds, the value passed should be 0.060.}}
|
|
-
Returns nothing
+
Returns the loop status of the animation. When this update caused the animation to loop, the method will return true, otherwise it will return false. If the sprite ID doesn't exist the method will return nil.
}}
}}

Latest revision as of 13:59, 5 March 2009

video.updateSpriteState(spriteId, timeStep)

This method updates a sprite state's animation.

Parameter Expected Type Description
spriteId An integer The ID value of the sprite that is being updated. This ID is retrieved when the sprite is created. See createSpriteState.
timeStep A number The time step measured in seconds. For example, if the time step is 60 milliseconds, the value passed should be 0.060.
Returns

Returns the loop status of the animation. When this update caused the animation to loop, the method will return true, otherwise it will return false. If the sprite ID doesn't exist the method will return nil.

Daisymoon Video Lib


Example

local function frameUpdate(timeStep)

   for i=1,#sprites do
      video.updateSpriteState(sprites[i], timeStep)
   end

end
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox