Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: san.daniele on Sun 14/04/2013 20:34:01

Title: Draw Hotspot over Object messes up clickable area
Post by: san.daniele on Sun 14/04/2013 20:34:01
Being new to AGS I jumped right into it and am working on my first game for some weeks now (… and enjoying every second of it).
While I try to find out as much as possible myself (I know how annoying beginners questions can be and most answers can be found in manual/forum), I hit a dead end when it comes to this. I realize this is probably a ridiculous question, I'm missing one the most obvious basics and feel kinda ashamed of having to ask.

As most of my graphics only outline the objects (so lots of transparent areas), I'm working with hotspots to interact with objects. While that seemed like a good idea, I can't get around this problem:

I can only interact with the hotspot where the graphic of the object isn't overlapping it. Let's take a door as example. I have the outline of the door as graphic, the hotspot covers the whole door. Now I can not click on those pixels occupied by the graphic (i.e. the doorframe or knob).

object.Clickable = false didn't change anything. I tried to change the objects baseline, hoping it would move it behind the hotspot. Didn't help.
A solution that would work is to apply the same code to the hotspot and object seperately … but that seems a bit complicated to do on hundreds of objects.


p.s. a general question if anyone cares to answer: I'm working a lot with objects, even where I could simply make them part of the background (as 'look at' is the only possible interaction). Should I avoid doing that (one 'problem' I can see being the game size becoming unnecessary big)?
Title: Re: Draw Hotspot over Object messes up clickable area
Post by: Khris on Sun 14/04/2013 21:21:48
If object.Clickable didn't do anything, you made a mistake, because that's exactly what you need to do.
You did use something like
Code (ags) Select
  oDoor.Clickable = false;in room_Load(), right?

Messing with the baseline won't help, because objects are always on top of hotspots, since the latter are just interactive parts of the background.

In general, using a hotspot is preferable to an object, yes, because it is easier to change and doesn't need a sprite. Objects are needed for things you can pick up or move, or that have animation. Hotspots are for static stuff (sky, wall, statue).
Title: Re: Draw Hotspot over Object messes up clickable area
Post by: san.daniele on Sun 14/04/2013 21:36:42
goddamn it!
I must have screwed that up like several times in a row as I didn't just try it once.

Feeling even more embarassed I'll call it a night. Thanks for your quick response!