room_tile_add_ext(ind, back, left, top, width, height, x, y, depth, xscale, yscale, alpha);
|ind||The index of the room to add the tile to.|
|back||The background from which the tile is taken.|
|left||The x coordinate of the left side of the tile relative to the background.|
|top||The y coordinate of the top side of the tile relative to the background.|
|width||The width of the tile.|
|height||The height of the tile.|
|x||The x coordinate of where to place the tile.|
|y||The y coordinate of where to place the tile.|
|depth||The depth of the tile in the room.|
|xscale||The horizontal scale of the tile. 1=normal size, 0.5=half, 2=double, etc.|
|yscale||The vertical scale of the tile. 1=normal size, 0.5=half, 2=double, etc.|
|alpha||The alpha (transparency) of the tile. 0=invisible, 1=opaque, 0.5=translucent etc.|
With this function you can add a tile to any room from any
background. You specify the position within the background to get
the tile from and the position within the room as well as the depth
that the tile should have and the alpha and scale of the new tile.
The function returns a unique id number for that tile that you can
use for further tile functions.
global.rm = room_add();
room_tile_add_ext(global.rm, tl_grass, 0, 0, 256, 32, 0, 400, 10000, 2, 2, 0.2 );
The above code will add a new room to the game and then copy the contents of the room indexed as "rm_Base" into it. It will then add a tile into the room taken from the background indexed as "tl_grass", setting its alpha to a value of 0.2 and scaling it by 2 on the x and y axis.