draw_button

Draws a simple button of any size, either pressed or unpressed.

Syntax:

GML Code Example

draw_button(x1, y1, x2, y2, up);


Argument Description
x1 The x coordinate of the left of the button
y1 The y coordinate of the top of the button
x2 The x coordinate of the right of the button
y2 The y coordinate of the bottom of the button
up Whether the button is up (true) or down (false)


Returns: N/A


Description

This function will draw a very simple, rectangular "button" using the currently selected draw colour and alpha where the up argument defines how the bevelled edge effect looks, as shown in the image below:


Example:

GML Code Example

draw_button(100, 100, 200, 150, !mouse_check_button(mb_left));

This will draw a button which will appear pressed if the left mouse button is held down.





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