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 / mouse cursor format?

Author
Message
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 13th Apr 2011 23:22
Hey all, I can't seem to figure out how mouse cursors work. No matter what I do the mouse is not at the correct location on the screen when I'm using a custom cursor in .cur format.

What is the correct size and structure of a cursor that DBP allows. I'm using GIMP to create the cursors.

[center]
Join the TGC Group!
http://tehcodez.groups.live.com
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Apr 2011 23:37
I think it's 32-bit 32x32 icons.

Health, Ammo, and bacon and eggs!
Grog Grueslayer
Valued Member
20
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Apr 2011 08:47
Using a .cur file and .ani for animated cursors is difficult sometimes. Sometimes the cursor is aligned so the coordinates MOUSEX() and MOUSEY() show is at the center of the cursor... other times it's the upper left corner. It just depends on how it was saved.

It may be better for you to redo that cursor as a .png instead and use CREATE ANIMATED SPRITE to make the cursor. It'll give you more options since it'll be a sprite instead of a cursor.



Attachments

Login to view attachments
Agent
20
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 14th Apr 2011 11:59
As I understand it, the coordinates of the mouse is always the hotspot (ie, the exact pixel upon which a click will take effect). The hotspot is definable in the .cur file, so depending one what file you're using the hotspot will be in a different place. If a mistake was made in the creation of the file (made more possible if you are a) making it yourself and b) confused about the outcome) then the final result will be difficult to make sense from.

Try experimenting with cursors you know work (like the default windows system ones) so you know your command set is correct. Then work with .cur files to create the look you want.

bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 14th Apr 2011 18:16 Edited at: 14th Apr 2011 18:17
hmm, I think I'll try some different software to create the cursors.

I'd rather use sprites but it makes my code needlessly complex and it's for something I want to keep barebones.

Thanks!

[center]
Join the TGC Group!
http://tehcodez.groups.live.com

Login to post a reply

Server time is: 2025-06-01 20:51:01
Your offset time is: 2025-06-01 20:51:01