Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

getSpriteScaleSpeed()

Purpose

Get a sprites scale speed

Description

This is the amount by which the sprite's scale factor is changed by when updatesprites is called

Syntax

scalespeed = getSpriteScaleSpeed( sprite )

xscalespeed = sprite.xscale_speed; yscalespeed = sprite.yscale_speed

Arguments

sprite handle of the created sprite

scalespeed vector containing the scale speed values { 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, { 10, 10 } )
maxsv = 30 // max scale speed
accsv = 1  // accelaration

loop
    clear()
    sv = getSpriteScaleSpeed( ship )
    if abs(sv.x) > maxsv then
        accsv = -accsv
    endIf
    setSpriteScaleSpeed( ship, { sv.x + accsv, sv.y + accsv } )
    updateSprites()
    drawSprites()
    update()
repeat

Associated Commands

getSpriteScale(), getSpriteSize(), setSpriteScale(), setSpriteScaleSpeed()

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.