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 / Pick Object with non-standard cursor problem

Author
Message
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 16th Aug 2010 17:32
I have created a new cursor in the shape of a circular cross-hairs, i.e gun sights, but when i try to select an object it is only the top left corner of the crosshair cursor that actually detects an object. I originally imported this cursor using the option in Synergy but found no way to offset any detection area.
So I loaded it as a sprite image and set it to the mouse x/y coordinates in the hope that "offset sprite" might help, but it doesnt.
I beleived that "Object = Pick Object( MouseX(),MouseY(),10,100)" should detect the object number with any overlap of the cursor but that doesnt work for me.
Can anyone suggest how i can effectively shift the "hot spot" of the circular cursor to its centre.

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 16th Aug 2010 17:59
This assumes your cursor is 20x20:


The fastest code is the code never written.
Battoad
AGK Developer
19
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 16th Aug 2010 18:43
Many thanks Hawkblood, works nicely now.

Login to post a reply

Server time is: 2026-07-25 07:01:58
Your offset time is: 2026-07-25 07:01:58