draw_enable_drawevent

Enables or disables the draw event.

Syntax:

GML Code Example

draw_enable_drawevent(enable);


Argument Description
enable Enable (true) or disable (false) the draw event for all instances.


Returns: N/A


Description

With this function you can choose to enable (true) or disable (false) the draw event for all instances in the game, thus giving you control over how and when things are draw, useful if you wish to implement a "frame skip" technique. Note that this doesn't just prevent instances drawing to the screen, it suppresses the draw event completely meaning that care should be taken since any game logic that is present in that event will not be run either.


Example:

GML Code Example

frame_skip ++;
 if (frame_skip mod 5) == 0
    {
    draw_enable_drawevent(true);
    }
 else
    {
    draw_enable_drawevent(false);
    }
 

The above code checks a variable and if it returns true, it enables the draw event, otherwise the draw event is disabled.





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