image_xscale (Game Maker)
( Game Maker 6.1, 7 )
image_xscale - horizontal scaling of a sprite.
Description
image_xscale is a local variable that contains the horizontal scaling of a sprite. It is by default 1, which means the sprite is scaled to 100% (its normal size). A value lower than 1 will decrease the size of the sprite and a value higher than 1 will increase it.
image_xscale only scales the sprite horizontally (makes it wider). If you want to scale a sprite equally, you must use image_xscale in conjunction with image_yscale
Examples
Example of Use
image_xscale = 2;
This will make a sprite twice as wide.
Keeping Aspect Ratio
To keep the aspect ratio of a sprite, you must use image_xscale with image_yscale.
image_xscale = 0.5;
image_yscale = 0.5;
This will make a sprite half its normal size.
Related pages
page revision: 16, last edited: 30 Jun 2012 15:48
Post preview:
Close preview