draw_surface_ext

Draws a surface with custom scaling, rotation, blending and alpha.

Syntax:

GML Code Example

draw_surface_ext(index, x, y, xscale, yscale, rot, colour, alpha);


Argument Description
index The index of the surface to draw.
x The x position of where to draw the surface.
y The y position of where to draw the surface.
xscale The horizontal scale.
yscale The vertical scale.
rot The rotation or angle to draw the surface.
colour The colour with which to blend the surface.
alpha The alpha transparency for drawing the surface.


Returns: N/A


Description

This function will draw the given surface as in the function draw_surface but with additional options to change the scale, blending, rotation and alpha of the surface being drawn. Changing these values does not modify the resource in any way (only how it is drawn).

NOTE: When working with surfaces there is the possibility that they can cease to exist at any time due to them being stored in texture memory. You should ALWAYS check that a surface exists using surface_exists before referencing them directly. For further information see Surfaces.


Example:

GML Code Example

draw_surface_ext(surf, 0, 0, 2, 2, 0, c_red, 0.5);

The above code will draw a the surface indexed in the variable "surf" at the (0,0) position in the room, with twice the original scale, blended red and semi transparent.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here