image_yscale (Game Maker)

( Game Maker 6.1, 7 )

image_yscale - vertical scaling of a sprite.


image_yscale is a local variable that contains the vertical 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_yscale only scales the sprite vertically (makes it taller). If you want to scale a sprite equally, you must use image_yscale in conjunction with image_xscale.


Example of Use

image_yscale = 2;

This will make a sprite twice as tall.

Keeping Aspect Ratio

To keep the aspect ratio of a sprite, you must use image_yscale with image_xscale.

image_xscale = 0.5;
image_yscale = 0.5;

This will make a sprite half its normal size.

Related Pages

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.