Cursor "hotspots"
Moderator: Moderators
Cursor "hotspots"
So I'm part way through creating a new set of cursors, just to move away from one bit of OTA IP, and to give mod makers a choice of cursors to use. The problem I am having is that the "hotspot", IE the actual pixel of the cursor image that is the location of the click, seems to be hardcoded to where it is in the OTA images.
For example, the default cursor (the arrow when you have nothing selected) has an active point at the top left pixel. This is all well and good when making a normal, windows-esque arrow for a cursor, but it would be nice if it was modifiable.
The active pixel for each type of cursors appears to be a set distance, in pixels from the top left of the image. Therefore unless our custom cursors follow the same general size as the OTA cursors they replace, they will not have the click point correctly positioned. Is there a configuration file somewhere I can edit, or is this hardcoded behavior?
If it's hardcoded, a patch such that Spring reads the active locations from a file in the anims directory might be in order. I know I will probably have to wright this myself, which will take a while (as I only know Java and Ada, chances are I'll have to learn a new language...)
For example, the default cursor (the arrow when you have nothing selected) has an active point at the top left pixel. This is all well and good when making a normal, windows-esque arrow for a cursor, but it would be nice if it was modifiable.
The active pixel for each type of cursors appears to be a set distance, in pixels from the top left of the image. Therefore unless our custom cursors follow the same general size as the OTA cursors they replace, they will not have the click point correctly positioned. Is there a configuration file somewhere I can edit, or is this hardcoded behavior?
If it's hardcoded, a patch such that Spring reads the active locations from a file in the anims directory might be in order. I know I will probably have to wright this myself, which will take a while (as I only know Java and Ada, chances are I'll have to learn a new language...)
The fact that it is coded as width/2, height/2 and not set numbers is good enough for me to work with. That was a smart way to set it up devs. Shame I'll have to make a more traditional default cursor than I was planning, but maybe that's for the best anyway. More traditional == easier to use.
And yes AF, that would work for moving the ones set to center.
And yes AF, that would work for moving the ones set to center.
-
- Posts: 501
- Joined: 18 May 2006, 21:19
wow... didnt expect you to actually start using that word...Erom wrote:Yeah, I think the problem isn't in the code, it's just that I don't know how to remove the old cursors, so I'm not overwritting some of the OTA data. No matter, duplicating frames to fill the space only increases the fize by a matter of kilobytes.
Thank you for all the help, Tobi.

out of curiousity, what cursors are you making?
- Tim Blokdijk
- Posts: 1242
- Joined: 29 May 2005, 11:18
Yeah... it's quite easy and possible to change the cursors without any source change whatsoever. It has been since day one.
http://taspring.clan-sy.com/wiki/Mod_De ... nt:Cursors
http://taspring.clan-sy.com/wiki/Mod_De ... nt:Cursors