Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Simple 4 Parameter Button

Author
Message
Bob 3456
20
Years of Service
User Offline
Joined: 1st Jun 2004
Location: In my computer chair
Posted: 4th Jan 2005 02:27 Edited at: 30th Jan 2005 13:15
This is a function i had been meaning to make for a long time to quickly make a main menu for a project i just started but i never got around to it, until now! You just enter the text you want the text, xpos, ypos, size and a changing variable that it passes, not really a paramater. The script changes the size of the box according to the size of the text.

Example of how to use the function - just copy and paste into the cli, change the setting to fullscreen and run.


Just the function - When using this function make sure you make a variable = the function and pass that variable as the value of hover. When using to make multiple button make all the variables different names.


Any imporvments, suggestions or comments are welcome.
ZtEaLmAx
19
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sweden
Posted: 10th Jan 2005 06:55 Edited at: 10th Jan 2005 06:56
Hi don't seems to get it to work
its failing on hover_value



Line 13:hover_value = menuItem("Play", 1024/2, 768/2, 50, hover_value, loading)


Quote of the week: Maybe this is a good day to die! - Warf (DS9)
Bob 3456
20
Years of Service
User Offline
Joined: 1st Jun 2004
Location: In my computer chair
Posted: 30th Jan 2005 13:11 Edited at: 30th Jan 2005 13:14
Sorry I havent visited the forums recently. I made this in dbpro, I dont know if that could have contributed or not. You may have to define hover value before the loop also. Im not quite sure what the problem is cause it works fine for me, so this is just my speculation.

[Edit] I feel stupid now, i reviewed the code and i have loading in there as a parameter because i tried to have the gosub be part of the function originally. Just remove that and it will work fine.
NinJA99
19
Years of Service
User Offline
Joined: 21st Jan 2005
Location: Windham, NH
Posted: 31st Jan 2005 07:44
Worked fine for me in DBC

END TRANSMISSION
ZtEaLmAx
19
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sweden
Posted: 3rd Feb 2005 13:59
hmm, im using dbpro too...weird..


Quote of the week: These humans i like, they are greedy! - Quark (DS9) - [href]www.darkbasicpro.tk[/href]

Login to post a reply

Server time is: 2024-11-23 17:07:22
Your offset time is: 2024-11-23 17:07:22