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.

Newcomers DBPro Corner / DBpro, multi-use button question.

Author
Message
Rixarn
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location:
Posted: 8th Jan 2006 06:04
Hi, thanks for reading this. I want to make a button that does something different each time is pressed. I cant get the logic to keep trace of how much clicks someone has done in the same button.

A simple demo showing a number increase by the no. of clicks someone does would do i belive.

Thanks
Rixarn
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location:
Posted: 8th Jan 2006 06:14
...actually the thing i want to do, is a button that turns ON with one click,, and then if the user clicks it again while ON, it turns back to OFF, but i guess the other example can give me the logic behind this too.

thanks
Rixarn
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location:
Posted: 8th Jan 2006 06:32
Well,, i somehow figure it out this way,, but is there a better way of doing it? thanks

TKsFox
18
Years of Service
User Offline
Joined: 25th Nov 2005
Location: No no no - Its not the Cyberspace
Posted: 8th Jan 2006 12:45
There is a little button - edit post - just to mention it

I would use the same way as u used

It's me...
Rixarn
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location:
Posted: 8th Jan 2006 16:38
I know this was an easy question but i couldnt figure it out till like 30 mins before i posted it, and also i dont know if thereĀ“s an easier more usefull way of coding it, but Thanks for posting.
crighton
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 8th Jan 2006 18:30
thats pretty close to what u (I) would use.
for a 3d back drop instead of making a box then delete it, just use


and using ink command in ur loop severly slows the program down as well.

set ink color before entering main loop, then if u need colored boxes, do some thing like this



some pretty nice effects can be done with this command.

hope that helps


aye!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 8th Jan 2006 22:12 Edited at: 8th Jan 2006 22:16
I would make it more boolean... I would avoid increasing the number beyond 1 (0=off 1=on). I would also add a timer so the mouseclick is only detected after the timer goes beyond a certain point. That way you can control how fast the switch works.




Rixarn
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location:
Posted: 9th Jan 2006 22:45
Well thanks both suggestions are good. I think ill be using colored boxes a lot so its a good advice crighton , thanks.
Also Grog Grueslayer, i liked a lot the idea of using timer to control mouse responses i belive that will solve some other things i tried to figure out. thanks
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Jan 2006 07:00
Np.


Login to post a reply

Server time is: 2024-09-24 13:33:58
Your offset time is: 2024-09-24 13:33:58