GetAtScreenXY - area rather than just pixel?

Started by kaputtnik, Fri 08/08/2008 11:41:34

Previous topic - Next topic

kaputtnik

Hello there.

I have a rather odd problem and can't think of a solution that wouldn't involve code trash galore, so I thought I might as well ask: I'd like to check whether there is character standing at a certain point where the player clicks. The problem is that the GUI is a home brew verb coin GUI with different buttons, so the mouse pointer will actually end up next to the character in at least 50% and thus not give a response.

Is it possible to define a field to be checked, rather than a single pixel coordinate? A fixed hotspot also won't work, because the characters will be standing at different locations too often.

Thanks in advance!
I, object.

Khris

Checking an area is problematic because there could be more than one character inside.
Why don't you store the character when the player presses the button down, then use that stored character to run the interaction as soon as the button is released?

Mazoliin

Consept from the verbcoin gui template:

Make to ints (mx, my), and when you click set mx, my to the mouse x and y co-ordinates. Then you can move the mouse how much you want, and still have the important co-ordinates.

SSH

To put that another way: store whether the character is there when the verb coin opens, rather than when the verb is selected.
12

kaputtnik

Ah, this does the trick! Hats off to you!
I, object.

SMF spam blocked by CleanTalk