SPRITE_Y_SCALE

SPRITE_Y_SCALE N,CY

SHRINKS OR STRETCHES THE HEIGHT OF TH SPRITE NUMBER N

  • Type: Command
  • Parameters: 2
  • Group: SPRITE

ACTION

The command SPRITE_Y_SCALE N,CY scales the size of the SPRITE designated by its number N, along the Y axis that is its height, by the coefficient CY. The size on X is unchanged (its height).

In a SCENE2D, the X axis is the horizontal axis, the Y axis is the vertical axis.

If CY=1, no scale is made on its height.

If CY>1, the SPRITE is stretched on the Y axis (height).

If CY<1, the SPRITE is shrinked on the Y axis (height).

SYNTAX: SPRITE_Y_SCALE N,CY

  • N = SPRITE number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of SPRITE objects.
  • CY = integer or a real coefficient. Must be greater than 0.

USE

  • The command SPRITE_Y_SCALE is used to change the width of a SPRITE.

ERROR

  • If the SPRITE number N does not exist.
  • If the coefficient CY is not a correct expression.
  • If the coefficient CY is less than or equal to 0.

EXAMPLE

rem create a 2D world number 1

scene2d 1

rem load a background picture

file_load 1,"city.bmp"

rem create a SPRITE number 1

sprite 1

rem load a picture to the SPRITE

sprite_file_load 1,"alien.bmp"

rem place the SPRITE on the SCENE2D

sprite_x_position 1,150

sprite_y_position 1,250

rem double the size of the SPRITE on Y axis

sprite_y_scale 1,2

SEE ALSO

SPRITE_X_SCALE