draw_surface

Draws the surface at a given position.

Syntax:

GML Code Example

draw_surface(index, x, y);


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.


Returns: N/A


Description

With this function you can draw a surface at a given position within the room, with the top left corner of the image being drawn at the specified x/y position.

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(surf, view_xview[0], view_yview[0]);

The above code draws the surface indexed in "surf" at same position as view[0].





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