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.

2D All the way! / Cursor Crosshair Problem

Author
Message
Weegi
22
Years of Service
User Offline
Joined: 6th Apr 2004
Location:
Posted: 7th Apr 2004 00:14
I was wondering wether anybody could help me change my mouse cursor into a 2D crosshair please?

Life's not a wheel, with chains made of steel, so bless me, come the dawn
medwayman
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: uk
Posted: 7th Apr 2004 01:35 Edited at: 7th Apr 2004 01:51
You need to use a sprite for your crosshair and then position it at the same location as the mouse pointer.



Edit: That was done in classic. If you are using Pro then run this:



Based on Amiga PD game Squigs. Early shots: http://www.custardsoft.pwp.blueyonder.co.uk/images/03.png

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 7th Apr 2004 02:33
Yeah, and you can use a sprite made from a single pixel for the collision detection.

Morloc
22
Years of Service
User Offline
Joined: 21st Mar 2004
Location: UK
Posted: 7th Apr 2004 17:14
Hmm sounds like youre doing something similar to me maybe. Maybe we can help each other out.

For my cursor I use


seems to work fine. A sprite crosshair is far better than a drawn lline one.

Morloc
Weegi
22
Years of Service
User Offline
Joined: 6th Apr 2004
Location:
Posted: 14th Apr 2004 22:14
Ive just had a look at yours and what we are tryin to create is something similar! But we are gettin nowhere with it
here's what we've got upto now, dont laugh!

Life's not a wheel, with chains made of steel, so bless me, come the dawn
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 14th Apr 2004 22:44 Edited at: 14th Apr 2004 22:45
You need something like...

x = mousex()
y = mousey()


or

sprite 1,mousex(),mousey(),image

Morloc
22
Years of Service
User Offline
Joined: 21st Mar 2004
Location: UK
Posted: 16th Apr 2004 02:12
The cursor is the easy part, wait till you start to animate your enemies and control the mouse etc.

Morloc
Zone Chicken
22
Years of Service
User Offline
Joined: 25th Jan 2004
Location: `~-..-~`~-..-~`
Posted: 18th Apr 2004 23:39 Edited at: 18th Apr 2004 23:48
this worked for me

`Track the mousekeys
mmovey# = mousemovey()
mmovex# = mousemovex()
mousey# = mousey()
mousex# = mousex()

`Setting up the cursor
`load crosshair to replace mouse
load image "mediacursor.bmp",3
`makes sprite from bmp
sprite 1,mousex#,mousey#,3
`Need to center the sprite with the mouse
offset sprite 1,15,15

these would be in the loop.
the offset sprite would be change depending on the size or your sprite so that the center of the crosshair is layed on the point of your mouse.

Login to post a reply

Server time is: 2026-06-09 15:43:25
Your offset time is: 2026-06-09 15:43:25