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()