D
DancingPlant
Guest
Hello all,
After a bit of trying to figure out this logic on my own I have decided to seek help and see if I could talk it through with some people that understand GUIs more thoroughly than myself (which I'm sure most people do).
I am working on a construction management style game for windows and am trying to make some menus. The idea behind the menus is that when the menu button is clicked (left pressed), a sort of "pop-up" menu will be created at the center of the screen, along with an exit button attached to it. This exit button can then be clicked to exit this "pop-up" menu.
I know how to draw the original menu button with a Draw GUI event but I am unsure of how to proceed from their, I am also using a hover feature that does an image_blend = c_white when the button is hovered over (done in Heartbeasts tutorial, it has worked very well for me before and I would like to implement it here). What I am having an issue with is how to create the "pop-up" menu along with its exit button when the initial menu button is clicked.
I have had a few thoughts but am unsure of which to implement, if they will even work at all. I have thought of placing if statements in the same Draw GUI event for the initial menu, something along the lines of this (not actual code, just my thought process):
But from there I'm not sure where to go, or if it is even correct, and how to go about implementing the hover over just the exit button for now (I am not going to be adding anything else to the "pop-up" menu until I can figure this section out) and exiting the "pop-up" menu, all while still having the current room visible behind the menus.
My second idea was to go a similar route from a tutorial by using a Global Left Pressed event to do all of the clicking:
I thought about this at first but was unsure of how I could make a Draw GUI occur from within this, I looked at both event_perform and event_perform_object but was unsure if implementing them would work in this case.
I have quite a bit of work ahead of me but really want to get just this section figured out for now before I can really implement anything else. I am not looking for code to just be given to me, but I would really love to be able to bounce ideas back and forth with someone who has more knowledge on the subject to help me better understand what it is I need to fix.
Thank you in advance for any comments and help!
After a bit of trying to figure out this logic on my own I have decided to seek help and see if I could talk it through with some people that understand GUIs more thoroughly than myself (which I'm sure most people do).
I am working on a construction management style game for windows and am trying to make some menus. The idea behind the menus is that when the menu button is clicked (left pressed), a sort of "pop-up" menu will be created at the center of the screen, along with an exit button attached to it. This exit button can then be clicked to exit this "pop-up" menu.
I know how to draw the original menu button with a Draw GUI event but I am unsure of how to proceed from their, I am also using a hover feature that does an image_blend = c_white when the button is hovered over (done in Heartbeasts tutorial, it has worked very well for me before and I would like to implement it here). What I am having an issue with is how to create the "pop-up" menu along with its exit button when the initial menu button is clicked.
I have had a few thoughts but am unsure of which to implement, if they will even work at all. I have thought of placing if statements in the same Draw GUI event for the initial menu, something along the lines of this (not actual code, just my thought process):
Code:
///Draw menu button
draw_sprite(shop button,0,x,y);
if (hover) {
image_blend = c_white;
if (left clicked) {
draw_sprite("pop-up" menu,0,x,y);
draw_sprite(exit button,0,x,y);
}
}
My second idea was to go a similar route from a tutorial by using a Global Left Pressed event to do all of the clicking:
Code:
///Check for hover
if (hover) {
somehow draw "pop-up" menu and exit button
}
I have quite a bit of work ahead of me but really want to get just this section figured out for now before I can really implement anything else. I am not looking for code to just be given to me, but I would really love to be able to bounce ideas back and forth with someone who has more knowledge on the subject to help me better understand what it is I need to fix.
Thank you in advance for any comments and help!