No Revisions Have Been Made To This Page
Can you suggest an edit for this page? Click Here
GML Code Example
draw_background_tiled_ext(back, x, y, xscale, yscale, colour, alpha);
|back||The index of the background to draw.|
|x||The x coordinate of where to draw the background.|
|y||The y coordinate of where to draw the background.|
|xscale||The horizontal scaling of the background.|
|yscale||The vertical scaling of the background.|
|colour||The colour with which to blend the background (use -1 or c_white to display it normally).|
|alpha||The alpha of the background (from 0 to 1 where 0 is transparent and 1 opaque).|
This function will take a background and then repeatedly tile it
across the whole view (or room if no view is defined), starting
from the coordinates that you give in the function and with each
tile scaled, colour blended and with the alpha that you define
(these properties are the same as those used in draw_background_ext).
NOTE: Colour blending is only recommended for the HTML5 target when WebGL is enabled, although you can still set the blending colour if it is not enabled and it will blend the sprite as normal. However all blending in this way creates a duplicate sprite which is then stored in the cache and used when required. This is far from optimal and if you use multiple colour changes it will slow down your games performance unless you activate WebGL. If you do not wish to use WebGL, and still require blended images, then you should consider using sprites and setting the sprite cache to help limit performance issues - see sprite_set_cache_size.
GML Code Example
draw_background_tiled_ext(bck_Sky, x, y, 2, 2, c_red, 0.5);
This will draw the background indexed in "bck_Sky" at the instances own x and y position, double its stored size and tiled in every direction in the room, as well as blended with the colour red and partially transparent.