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 / Weird cursor/pick object trouble

Author
Message
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 12th Jun 2005 22:23
Quote: "Weird cursor/pick object trouble"

The reason for that title is i'm not sure what is wrong!


Basically when the mouse is over a certain object it should change the cursor image. I have loaded them all in OK but the only one that seems to work is the Pick Object(MouseX(),MouseY(),5,5) > 0 one. I don't know why. Could you help me shed some light on this?


Thanks to Animeblood for the Logo!
RiiDii
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 13th Jun 2005 00:24
Mainly, when it gets to the last If/Then, if it's not over object number 5, it will always change to mouse=0, regardless if it was changed to another mouse in one of the previous If/Then statements.

Your best bet is probably to call the Pick Object only once and store the result in a variable. Then use Select/Case to determine which mouse to change to. Like this:

po=Pick Object(mousex(),mousey(),3,7)
Select PO
Case 3,4
Change Mouse 1
EndCase
Case 5
Change Mouse 4
EndCase
Case 6
Change Mouse 3
EndCase
Case 7
Change Mouse 2
EndCase
Case Default
Change Mouse 0
EndCase
EndSelect

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 13th Jun 2005 00:40
Wow thanks for that code. I never new Cases existed in DBPro. (I've used them a bit in C++ though)

EDIT: Oh it works its just that now it won't display the cursor. It just dissappears. Oh except for when changing mouse to 1


Thanks to Animeblood for the Logo!
RiiDii
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 13th Jun 2005 01:32
Quote: "Values 2 to 31 are custom cursors that can be specified in the project media section and selected
with this command."

Did you load in your own mouse cursors yet?

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 13th Jun 2005 01:34
Hehe I just checkde the cursor bit and only two were loaded. Even though I definetly loaded them all in earlier...weird. Well thats tha problem fixed.


Thanks to Animeblood for the Logo!

Login to post a reply

Server time is: 2025-05-29 10:34:34
Your offset time is: 2025-05-29 10:34:34