I see, but I still dont know what you want exactly for your game, cuz there are endless way of approaching this depending on
how much stuff, and what kind of functions needs to be in there, like scroll bars, buttons, lists, player avatar, questlogs, etc...
You should figure that out before you start so you don't end up rewrinting bunch of code...
I would recommend you to have different objects for different menu types, like shops, tech tree, quest log etc,
you can still make the illusion that its one object and that it switches flawlessly between them,
but write the code in different ones...
Your first script could be just scr_menu_typ(argument0), where you tell the script which menu type to create,
1 = shop, 2 = tech tree, 3 = questlog... within the script a switch(argument0) can check what you will create,
then you create obj_menu_shop, or obj_menu_techtree, etc...
The object code depends on what you need the menus to do, things to keep in mind,
* Will all info fit on one page, or do I need to switch pages/scroll?
* What kind of buttons and how many do I need?
* Is the menu x, y, titles etc static = always the same, or do they change dpeeing on which element on
the map summoned them? then you might need to have arguemnts in the first script that can pass down that
information. example scr_menu_type("shop", npc_1.x, npc_1.y, npc_1.name); etc, if you call in another menu
but the script requries more arguments then just write scr_menu_type("techtree", 0, 0, 0); since it dont matter, you
wont use them...
Back to when coding the objects, if you can handle to code well, you can handle all buttons by using arrays
from one object, you can create your buttons using code, button_back[5], and then u define a bounding box
with code, as well as x, y, if its selected or not... or you can have even more objects doing that, but I find it
much easier with variables...
example
button_back[0] = left
button_back[1] = right
button_back[2] = top
button_back[3] = bottom
button_back[4] = hover
button_back[5] = slected
Whatever you need to know about it.
I have done many menus, level editors etc, my advice is to design it first, before you code so that you know exactly what you need,
and what you should do... if you will get stuck or need help, just send me a message... I hope this have given you some kind of insight...
And its just one of many ways to do it, but it all comes down to what you need for it to do...