Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setSpriteAnimFrame()

Purpose

Set the current frame in an animated sprite

Description

Set the current frame in an animated sprite to be the specified frame number

Syntax

setSpriteAnimFrame( sprite, frame )

Arguments

sprite handle of the sprite

frame number of the current animation frame in the sprite

Example

image = loadImage( "Untied Games/Explosion 01", false )
explosion = createSprite()
setSpriteImage( explosion, image )
setSpriteAnimation( explosion, 0, 69, 60 )
setSpritelocation( explosion, { gWidth() / 2, gHeight() / 2 } )
setSpriteScale( explosion, { 5, 5 } )
tiles = getSpriteAnimFrameCount( explosion )

for i = 0 to tiles loop
    clear()
    setSpriteAnimFrame( explosion, i )
    drawSprites()
    update()
repeat

Associated Commands

getSpriteAnimFrame(), getSpriteAnimFrameCount(), getSpriteAnimSpeed(), setSpriteAnimation(), setSpriteAnimSpeed()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.