tile_set_scale

Sets a tile's horizontal and vertical scaling.

Syntax:

tile_set_scale(index, xscale, yscale);


Argument Description
index The index of the tile to set.
xscale The tile's horizontal scale.
yscale The tile's vertical scale.


Returns: N/A


Description

With this function you can scale a tile which will draw the tile image stretched by the given amount (with 1 being the default horizontal and vertical scale).


Example:

var tile;
tile = tile_layer_find(-1000, mouse_x, mouse_y);
if tile_get_xscale(tile) != 1 || tile_get_yscale(tile) !=1
   {
   tile_set_scale(tile, 1, 1);
   }

The above code will first get the index of a tile at the mouse position with a depth of -1000 and then use that value to check whether the tile x and y scale is anything other than 1, and if it is it sets the tile scale to 1.


Back: Background Tiles
Next: tile_exists
© Copyright YoYo Games Ltd. 2018 All Rights Reserved