Also, here's the basic approach to creating buttons that Sophia was suggesting:
In my call to the FSR (full screen renderer), the second parameter is the "click" function,
mhf_options_click in this case.
Code: Select all
function mhf_options()
dsb_fullscreen(mhf_options_draw, mhf_options_click, true, true, { fade = false, game_draw = false })
end
Note the table of booleans in parameter 5: if you set
game_draw = true, the full game UI is drawn behind your FSR, so if there's blank spaces or semi transparency in any of the bitmaps used in your FSR, the game will show through.
Here's my click function. It's constantly running while the FSR is displayed, and the
x,y,buttonpressed variables will constantly update as the player moves the mouse and clicks it. So you can respond to that input by checking the position of the mouse and checking whether it's clicked. In my function, all I do is
return true, which does nothing other than cause the FSR to abort/close. So whatever you want to do for that mouse click in that position, just add your code before the
return true command. For example you could send a M_ACTIVATE message to a specific door, monster generator, etc, or display another FSR. Just remember that every FSR must eventually exit, and each FSR will return control to where it was called from.
Code: Select all
function mhf_options_click(x, y, buttonpressed)
if ((x > 468 and x < 602) and (y > 436 and y < 468)) then
if (buttonpressed == 1) then
return true
end
end
return nil
end