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.

DarkBASIC Professional Discussion / Any tips or help on using the mouse?

Author
Message
Dragon slayer
19
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 15th Jun 2013 23:19
Alot of you have probably seen my other posts and know I am working on a text project now. All my menus and choices now are like

1.) create character
2.) move
which isn't bad, kind of retro and that is kind of what I am going for. I am trying to do a clone of a mid 80's RPG.

I would like to try mouse commands for the selections. I read the section in the hands on book rather quickly. It seems like a lot of work converting everything I want to be a selection into a sprite or button.

So I was wondering if anyone had any very simple ways to select text. Like click on create character then be taken to that screen without having to turn everything into a button or sprite?
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 15th Jun 2013 23:30
I had uploaded a game with the source code on the DarkGDK board, called Looper. It uses a very simple to follow text based menu function. Check it out.
Dragon slayer
19
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 15th Jun 2013 23:45
I saw that post over there. I will check it out. Thanks
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 16th Jun 2013 04:22 Edited at: 16th Jun 2013 04:24
You can use zones.

if zoneclicked(X1,Y1,X2,Y2... put your imaginary rectangle in here)=1
Do whatever
play sound 1
sync
repeat
until mouseclick()=0

function ZoneClicked(X1,Y1,X2,Y2)
J=0:X=mousex():Y=mousey()
if X>=X1 and X<=X2 and Y>=Y1 and Y<=Y2 then J=1
endfunction J

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Jun 2013 05:47
I haven't looked at it in awhile, so I'm not sure how much detail it goes into about each component, but I wrote a tutorial on creating GUIs. Maybe something in there might help ya out.

http://dbcodecorner.com/?page=tutorials

WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 17th Jun 2013 20:19 Edited at: 17th Jun 2013 20:20
Here is a text based mouseover menu, designed to not use synchronization.

Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 20th Jun 2013 01:09
Dragon slayer, what's you current mouse "sudo" code?

Mine basically does this;

Detect Mouse Desktop Position
Detect Mouse Application Position
Detect Mouse Button Press, Release, Hold, Quick Click, Long Click, Delayed Hold.

Have you got these, or similar position & button checks working at this stage?

Regarding selection, consider Matrix1 Utilities Zones commands. I've tested these for make shift buttons in conjunction with Advanced 2D a2fillbox, and they work a treat.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Jun 2013 02:20

Login to post a reply

Server time is: 2026-07-07 00:31:48
Your offset time is: 2026-07-07 00:31:48