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 / [DBP] Menus functions

Author
Message
Serge Adjo
17
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 20th Dec 2008 17:33 Edited at: 27th Dec 2008 01:32
hi, please try this updated version of the menus function introduced in the newsletter by Steve Vink;

1) main program ;


then, the include file, contains the re-usable code & functions;


note:
Simply copy/paste it in your editor: firstly the main program, then, you can paste the second program right after, in the same page.
I've tested it with DBP upgrade 7.1
- the menus are now animated : sprites interact with mouse (soon, I'll add sound effects...)-(no external media needed )
if you need anything, more info, feel free to ask me, there
please tell me what do you think ?

pascontent.
Serge Adjo
17
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 28th Jan 2009 15:23 Edited at: 28th Jan 2009 21:09
hi, try this new menu program, changes are: text color switch, no interaction with title of the menu (previously, option 1 was activated by clicking on the menu title but it should not);no more resizing sprites, as the effect wasn't so good I think. :


to understand the program, read this (an extract from newsletter-30-june-2005: http://thegamecreators.com/data/newsletter/newsletter_issue_30.html#9 :


note: global variable V_Premier_spriteE is used to define the id number of first sprite and also correspond with id number of the sprite "menu title" so simply use this variable like this: MakeMenu("My example Menu",1,V_Premier_spriteE)

todo: adjust size of text with screen resolution while avoiding too big sprites (to limit the memory used by sprites): sprites height should be 8, 16, 32, 64 or 128 pixels in size and then stretched according to screen resolution
-to replace the cursor with a custom one, should be a sprite pasted at mouse x,y screen coordinates (I think about cross hairs, for an FPS)
-to add some nice sounds effects

pascontent.
RoyalBlood
15
Years of Service
User Offline
Joined: 8th Apr 2009
Location: Stuck in this box!
Posted: 16th Apr 2009 02:47
COuld not understand command at line 42...
Line 42 for me is "InitMenu()"

AMPConcepts.webs.com
Serge Adjo
17
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 24th May 2009 14:33 Edited at: 17th Jun 2009 09:35
hi, try this :


to understand the program, read this (an extract from newsletter-30-june-2005: http://thegamecreators.com/data/newsletter/newsletter_issue_30.html#9 :

note: global variable V_Premier_spriteE is used to define the id number of first sprite and also correspond with id number of the sprite "menu title" so simply use this variable like this: MakeMenu("My example Menu",1,V_Premier_spriteE)

todo: adjust size of text with screen resolution while avoiding too big sprites (to limit the memory used by sprites): sprites height should be 8, 16, 32, 64 or 128 pixels in size and then stretched according to screen resolution
-to replace the cursor with a custom one, should be a sprite pasted at mouse x,y screen coordinates (I think about 'cross hairs', for an FPS)
-to add some nice sounds effects when clic
-to change varibale V_premiersprite to be automatically an sprite number that is available.

come see my DarkAI examples: <a>http://forum.thegamecreators.com/?m=forum_view&t=151610&b=30</a>
http://forum.thegamecreators.com/?m=forum_view&t=151610&b=30

Login to post a reply

Server time is: 2024-05-03 16:01:11
Your offset time is: 2024-05-03 16:01:11