Clickable hotspots

Get help using Construct 2

Post » Thu Feb 14, 2013 6:43 am

Hi all! Working my way through the early days of Construct. I've completed several tutorials and experimental games then decided to try making a point and click room escape game. Nothing fancy, just one of those still-screen games where you find a key, open a safe with a number code, unlock a door, etc. Think Myst but way, way simpler.

I ran into a problem I can't seem to solve. Is there a way to create invisible clickable hotspots on a layout? So far I've been using invisible buttons and images chopped into pieces and calling the Mouse: On left button click on object event, but it seems like there has to be a better solution. As far as I know, I can't set image points in the animation dialogue and reference those, so I'm at a bit of an impasse.

Any thoughts or resources you could point me to?
B
7
S
1
Posts: 8
Reputation: 720

Post » Thu Feb 14, 2013 7:00 am

Uh, I think it would be much simpler to just make a solid color square sprite, set its visibility to invisible and place it where you want the player to click on. re-size/re-shape it till it is covering the area you want clickable set a variable instance on it something like "click point" then just use the same object and place it in the spots you want clickable then change the properties of each click point so the variable is a different number for each point, then in the even sheet make an event like

1: On left mouse click "click point" (or whatever you name the square)=
   2:click point is at 0 = whatever action you want.
   3:click point is at 1 = whatever action you want.

so you pretty much have a set of subevents off that one event and it will check the instance variable and do something different even though it is the same sprite they are clicking on.

I can make a capx if you need an example.

B
22
S
5
G
1
Posts: 81
Reputation: 2,271


Return to How do I....?

Who is online

Users browsing this forum: bluemonkey, Khamsou and 24 guests