Dr_Nomz
Member
So I have this button:
That basically allows it to draw a rectangle whenever it's hovered over, and then it allows you to click on it, which executes some code.
The above draws the rectangle so this can happen.
I also want the button to appear at specific coordinates based on the room view.
Like with this code, for example:
Which is the code for drawing the Inventory object at the correct position on the screen.
So how do I combine them to make a working button?
I've tried several combinations to get it working, but none of them have worked so I'm asking here.
Code:
if (abs(mouse_x - x) < 50) && (abs(mouse_y - y) < 50) && showInv == true{
draw_set_color(c_white);
draw_rectangle(x-47,y-47,x+46,y+46,0)
The above draws the rectangle so this can happen.
I also want the button to appear at specific coordinates based on the room view.
Like with this code, for example:
Code:
var x1,x2,y1,y2;
x1 = view_xview[0];
x2 = x1 + view_wview[0];
y1 = view_yview[0];
y2 = y1 + 104;
So how do I combine them to make a working button?
I've tried several combinations to get it working, but none of them have worked so I'm asking here.