turning off pixel perfect detection for individual characters? {SOLVED}

Started by EnterTheStory (aka tolworthy), Mon 21/04/2008 18:29:10

Previous topic - Next topic

EnterTheStory (aka tolworthy)

Is it possible to selectively turn off pixel perfect clicking? I need to be pixel perfect for large or stationary characters, but small and fast moving characters are almost impossible to click on :)

SSH

You can add custom code to check for clicks near them:

Code: ags

function mousenear(Character *who, int howclose) {
  int xd=mouse.x-who.X;
  int yd=mouse.y-who.Y;
  return ((xd*xd)+(yd*yd)) < (howclose*howclose);
}

12

Radiant

One other way of doing it is by creating a large character that Follows the small/fast character Exactly, and is placed on top of it. If it's simply a big white square, you can click on it; and if you set its transparency to 100%, you won't actually see it.

EnterTheStory (aka tolworthy)

Thanks for the suggestions. Sounds like they would work.

In this case I can't use ghost followers, since I have over forty characters on screen already, and AGS wont allow more than 50. And there are also issues with any extra code slowing down the scene.

I finally opted for a completely different solution: the small character problem is made much worse because they all look similar, and are all moving erratically. So I made it so the user can press the space bar to stop them, then clicking on one is much easier.

Thanks again for the ideas.

SMF spam blocked by CleanTalk