Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setSpriteScaleSpeed()

Purpose

Set a sprites scale speeds

Description

Set a sprites scaling speeds. These are the amount that the sprite scale is changed by in the horizontal and vertical axes when updatesprites is called

Syntax

setSpriteScaleSpeed( sprite, scaleSpeed )

setSpriteScaleSpeed( sprite, xScaleSpeed, yScaleSpeed )

sprite.xscale_speed  = xScaleSpeed; sprite.yscale_speed  = yScaleSpeed

Arguments

sprite handle of the created sprite

scaleSpeed amount to add to the horizontal and vertical scale of the sprite at each updatesprites call { x, y }

xScaleSpeed amount to add to the horizontal scale of the sprite at each updatesprites call

yscaleSpeed amount to add to the vertical scale of the sprite at each updatesprites call

Example

image = loadImage( "Untied Games/Enemy small top C", false )
ship = createSprite()
setSpriteImage( ship, image )
lastpos = { gWidth() / 2, gHeight() / 2 }
setSpriteLocation( ship, lastpos )
setSpriteScale( ship, { 1, 1 } )
sv = 0 
maxsv = 30 // max scale speed
accsv = 0.6 // accelaration

loop
    clear()
    c = controls( 0 )
    printAt( 0, 0, "Use left joystick left or right to change scale speed" )
    sv = sv + c.lx * accsv 
    if abs( sv ) > maxsv then
        sv = sv / abs( sv ) * maxsv
    endIf
    setSpriteScaleSpeed( ship, { sv, sv } )
    updateSprites()
    drawSprites()
    update()
repeat

Associated Commands

getSpriteScale(), getSpriteScaleSpeed(), setSpriteScale()

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.