GenGrowSprite


GenGrowSprite sprite, growToX, growToY, msDuration

sprite

The sprite to grow (scale).

growToX

This is the X scale to grow to. Values are 0.0 - 1.0+

growToY

This is the Y scale to grow to. Values are 0.0 - 1.0+

msDuration

This is the duration of the grow in milliseconds.

This command can be used to "grow" (scale) a sprite. Sprites can grow smaller or bigger. The scaling begins with the current sprite scale and grows the sprite to the specified X and Y scale. The whole scaling event is timed to take msDuration milliseconds. This command can be made to call a user defined Event subroutine upon completion.





include "Game Engine Constants.inc"

'...Turn on the game engine and init a sprite...

SetOnGenSpriteModifierSub sprite, onSpriteModifier()

GenGrowSprite sprite, 1.5, 1.5, 5000

'...continue with program...

Sub onSpriteModifier(sprite, type)

if type = Mod_Grow_Complete then

GenSetSpriteRed sprite, rnd(100)
GenSetSpriteGreen sprite, rnd(100)
GenSetSpriteBlue sprite, rnd(100)

endif

End Sub




SetOnGenSpriteModifierSub


Game Engine Mode






Become a Patron