How do I ... "is touching object"

Get help using Construct 2

Post » Mon Oct 20, 2014 6:16 pm

So, I've run into a situation.

If you've ever played a kairosoft game you'll see they made their buttons more touch friendly by only activating on double tap, and highlighting on normal tap.

I would like to do something very similar. I only want buttons to activate on a full tap event (this works) but I want them to highlight while being touched

I would think that

Is touching object (my sprite)

would work, but it does not, that seems to only work with the compound condition:

on any touch start
is touching objecting (mysprite)

The problem with this is it only snags the object you poke. I'd like to activate a hi-lite effect on everything in a family while a finger is being dragged around on it.

The game also supports mouse, but it doesn't look like anything I'm doing with the mouse effects this particular issue as objects under the mouse are lit up regardless if it's a click or a hover.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
13
S
4
Posts: 303
Reputation: 1,705

Post » Mon Oct 20, 2014 9:27 pm

You could cheat it so that when you touch, you move an invisible sprite object to that location, and use a "sprite 1 is overlapping sprite 2" condition.

thus, it will remain highlighted while those objects are overlapping until the user presses somewhere else.

just make it a small object whatever you end up using
B
83
S
40
G
15
Posts: 987
Reputation: 16,847

Post » Mon Oct 20, 2014 9:32 pm

Or another idea, is to make a counter for the button. on the first tap, it remains highlighted, but if the counter = 2 then activate whatever the button is supposed to do.
B
83
S
40
G
15
Posts: 987
Reputation: 16,847

Post » Tue Oct 21, 2014 12:51 am

question about sprite1 overlapping sprite 2... could I just check for the current mouse position instead? Would it be less resource intensive to only check on point ? Prolly doesn't matter lol. Thank you for the idea!
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
13
S
4
Posts: 303
Reputation: 1,705


Return to How do I....?

Who is online

Users browsing this forum: MoscowModder and 11 guests