PDA

View Full Version : How do I get to current x, y coordinates ?



Kelvin
07-20-2002, 11:33 AM
As title. Is it possible to get that ?
Thanks !

Salem
07-20-2002, 01:02 PM
Coordinates of what?
Your cursor
Your mouse
Your house

Kelvin
07-20-2002, 01:35 PM
I think is cursor...(I'm not sure.....sorry)
Actually, my program is doing things like:
1) print a char 'C'
2)if the user enter R5 then the char 'C' will move 5 "steps" to right, L3 will move 3 "steps" to left.
3)Display the coordinates of char 'C'

I have no problem except 3).

Salem
07-20-2002, 01:38 PM
Rather than trying to figure out where it is now, remember where you last moved it to.

int cur_x, cur_y;

Then modify those values as appropriate, and draw your text in the new position

Kelvin
07-20-2002, 01:45 PM
Originally posted by Salem
Rather than trying to figure out where it is now, remember where you last moved it to.

int cur_x, cur_y;

Then modify those values as appropriate, and draw your text in the new position

Thanks ! It works !
but is it impossible to get the current position if I don't use this method ?

Salem
07-20-2002, 01:49 PM
Well there should be a way, but its bound to be compiler specific

Kelvin
07-20-2002, 01:52 PM
Really thanks!