[SOLVED] Extending the surface area of an object or character

Started by johanvepa, Sat 02/01/2016 10:45:38

Previous topic - Next topic

johanvepa

My test player has trouble picking up items (objects or characters) as they look quite small on the screen and she has to be careful when positioning the mouse cursor over the item in question. I'd like to sort of "increase mouse sensitivity area" when it comes to mouse clicks and IsInteractionAvailable functions. Is this possible?

Gurok

What I often do, and I believe it's a common technique, is put a thick border of rgba(0, 0, 0, 1) -- that's black with 1/255 opacity, around the object. You won't notice it in game, and it allows you to customise the clickable area to your liking. When you import the sprite into the sprites section of the project, you'll see a big pink outline where the almost transparent black is.

You can also use hotspots, but it depends on how you're currently using hotspots and takes a bit of finessing if you have an object sitting over a hotspot you've defined for the background. e.g. a vase object on a window sill hotspot. For simple cases though, it works well. Just define a hotspot and make its look/interact methods call the object's look/interact methods. You'll then want to disable the hotspot for the object when the object gets picked up.

There are other, more complicated ways to define a tolerance for object highlighting. Basically, you can replace the entire mouse hover and click processing functionality in AGS, if need be. That's a little involved though, and I'd recommend trying one of the other two methods first to see if either suits you.
[img]http://7d4iqnx.gif;rWRLUuw.gi

johanvepa

Thanks Gurok, this seems very doable.

Especially your first solution is good within the scope of my project.

But I'm a little unsure how to make the border opaque. Is it best done with a dynamic sprite (can do, just wondering if there is an even easier solution)?

Gurok

I would just make changes to the sprites themselves and re-import them, opting to preserve alpha channel. Here's the blue cup altered, for example:



It could *possibly* be done with dynamic sprites, but working with transparency and dynamic sprites is a bit prohibitive. Is there a reason you want a system for adding this border? How many sprites does it affect? In my case, it's only ever been the odd tiny thing like a cup or a pen.

Also, I forgot to mention this, but I believe alpha channels might require that your game is a 32-bit colour game. I think most people work with that nowadays anyway.
[img]http://7d4iqnx.gif;rWRLUuw.gi


SMF spam blocked by CleanTalk