|
ScaleSprite | ||
ScaleSprite SpriteIndex, Scale# | ||
Parameters: SpriteIndex = The number of the sprite you wish to scale Scale# = The scaler to apply this sprites combined width & height |
||
Returns: NONE | ||
The ScaleSprite command lets the user set both the width / height scaling factors of the a sprite. Scale Values 0.00 = Sprite is scaled by zero. 0.25 = Sprite is 25% of it's normal size 0.50 = Sprite is 50% of it's normal size 0.75 = Sprite is 75% of it's normal size 1.00 = Sprite is 100% of it's normal size. 2.00 = Sprite is 200% of it's normal size. 3.00 = Sprite is 300% of it's normal size. Here's an example animation of sprite scaling from 0.0 to 2.0. So it starts out at basically a point, then zooms into twice it's actual size, and zooms out again. FACTS: * Using a negative scaling value will Flip / Mirror a sprite * In order to see the effect of sprite scaling, the sprite needs to set to Rotation Mode using the SpriteDrawMode command. * Note: For the best performance!, it's highly recommended that a scaled sprites image be previously prepared in FX image format (see PrepareFXimage, LoadFxImage) Mini Tutorial: This example is really 3 parts. Part #1 creates a image out of a triangle shape and a circle. Part #2 creates the sprite, the sprite is then set to render the previously created image as it's graphic to rotate. Part #3 is the programs main do/loop. Which allows the user to rotates the sprites with the left/right arrows key controls and then renders it
This example would output.
|
Related Info: | PrepareFXimage | RotateSprite | ScaleSpriteX | ScaleSpriteXY | ScaleSpriteY | SpriteDrawMode | TurnSprite : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |