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.

Author
Message
Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 21st Aug 2005 13:20
I am relly new to dark basic pro and i dont know how to (on the main menue) allow people to click on buttons
xtom
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 21st Aug 2005 16:05
You could use something like the code below to check where the mouse is on the screen. Just use your buttons positions.

if mousex()>10 and mousex()<80
if mousey()>10 and mousey()<80 and mouseclick()>0
rem button pressed code
endif
endif

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Aug 2005 20:59
Here's a button code:
It shows how to use functions, use sounds with the functions and make buttons.



Immunity and Annihalation makes Immunihalation...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Aug 2005 00:01
If you had done a quick scan of the forum, you would have found this topic covered a number of times - including this that I posted:

http://forum.thegamecreators.com/?m=forum_view&t=59061&b=7

It should point you in the right direction for one very basic method of doing it.

When you understand what's going on, you can use sprites.

Sven B

Might be just me, but I think your use of the Tab for indentation makes your code very hard to read.

You should consider setting your editor to use 2 or 3 spaces instead.

TDK_Man

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd Aug 2005 09:41
inc my editor, tab = 3 spaces. But when i copy it in code tags, it's 5 spaces.



This ones fully commented.

Immunity and Annihalation makes Immunihalation...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Aug 2005 18:00 Edited at: 22nd Aug 2005 18:01
Sven B:

That's strange.

In all your code that you post, it's actually a full tab that you are getting - that's 8 spaces per indent.

Don't know about anyone else, but after 3 indentations of your code, the line is 24 characters across the screen!

It must be your editor because I copied and pasted your code into my editor and immediately copied and pasted it back onto the forum and it doesn't have all the spaces in it.

What editor are you using?



TDK_Man

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd Aug 2005 18:27
The ordinary DBC editor. (You know, the one with the black background, 2 pages, white text and yellow comments).

But I'm planning to start working with your editor since my eyes began to hurt because of the black-white colors...

Immunity and Annihalation makes Immunihalation...
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Aug 2005 14:58
Quote: " The ordinary DBC editor"


Crikey! You are brave... lol.

TDK_Man

Login to post a reply

Server time is: 2024-09-24 03:22:01
Your offset time is: 2024-09-24 03:22:01