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.

Dark GDK / How can I use dbChangeMouse() ?

Author
Message
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 27th Feb 2006 21:39
Hello,

I used the dbChangeMouse function in DBP to switch between cursors, and would like to do the same now with DarkSDK. I saw that the functin is in the header file of Input, but I assume it doesn't do much, since I don't see a way to specify the cursors!

How can I do this in VS?

greets,
Barnski

-- I just started with DarkSDK, by translating DBP Projects. --
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 28th Feb 2006 03:25
What you have to do is create a resource that holds a cursor file that you have created. You do this in MS Visual C++ by going to the same button you would use to add a window and there should be an option to add a resource instead of a dialogue box. Click that and then give the cursor resource that you load a number that defines it. After that use the macro that you assign to the named loaded cursor and pass it to the dbChangeMouse function. Hope this helps.

The scarecrow has no mind, but serves its function well.
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 28th Feb 2006 11:28
Quote: "then give the cursor resource that you load a number that defines it."


I loaded the cursor resource into the VS project, but cant figure out how to assign a number to it?!

-- I just started with DarkSDK, by translating DBP Projects. --
Acolyte
18
Years of Service
User Offline
Joined: 3rd Feb 2006
Location:
Posted: 28th Feb 2006 21:27
Sorry, that's not really what I meant. When you loaded the cursor file there should have been an entry that was made in one of the header files that links a variable or a number index to the cursor that was loaded. Basically what this comes down to, is C++ assigns a numeric or variable value as an index to the cursor that you loaded, you can then access the cursor by passing the reference of it to the function in SDK. If for some reason the file wasn't linked inside the main header, you can place it there yourself. I'm pretty sure that's how the function works, if not, then my appologies.

The scarecrow has no mind, but serves its function well.
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 2nd Mar 2006 15:03
Ok I got that now; I need to make

1) Add resource...
2) Import...
3) save all files

Voila I get the resource.h file, which has a IDC_CURSOR1 defined to 101

But then the following does not show up my cursor:


I also tried all cursor values from 0 to 150, only 0 and 1 show me the standard cursors (pointer and hourglass), but 101 does not show my custom cursor...

also, in the DBP help is written:
Quote: "
dbChangeMouse
This command will change the cursor that belongs to the mouse pointer. A value of zero uses the applications arrow cursor and a value of one will use the hourglass cursor. Values 2 to 31 are custom cursors that can be specified in the project media section and selected with this command.
"


so the function accepts obviously only values between 2 and 31!
Well I will try now to change the ID of the cursor to 2...

[some minutes later...]
it did not work; I made a new symbol, called it IDC_CURSOR_HAND, assigned value 2 to it, and changed my cursor ID to that symbol.
Saved all files, so resource.h got updated to this: (oh and I changed the next_res_id value too, but that souldn't do any harm)


then I tried to see if my cursor gets drawn, but NO it doesnt (changemouse(2))... I know the cursor loaded in DBP, so it should work!


So what am I doing wrong??

Thanx for help

barnski

-- I just started with DarkSDK, by translating DBP Projects. --

Login to post a reply

Server time is: 2024-05-18 21:48:19
Your offset time is: 2024-05-18 21:48:19