Touch screen question!

Discussion and feedback on Construct 2

Post » Sun Sep 20, 2015 6:03 pm

First of all I was thinking of posting in the "How do I....?" section but it seems like it's spammed hard by chinese.

Secondly I have a question about touch screen and something that has been bothering me.
I am using touch screen movement where my player is moving in the direction pressed on screen.So wherever you touch the screen, player moves in that direction.For testing purposes im using a mouse and it's set angle(player.x, player.y, mouse.x, mouse.y)
On this image you can see my inventory at the bottom.And even when I press on the inventory, player will move.My question is: How do I isolate inventory area from player movement. When I press on inventory i just want it to use the item?


Image
B
10
S
1
Posts: 39
Reputation: 588

Post » Sun Sep 20, 2015 6:39 pm

What I would try in a first attempt is to add to your moving condition something like "AND is not touching inventoryBackground".

EDIT: as InventoryBackground I mean the image you have below your inventory area. In that way you cover whole area as exception. So whenever you touch the screen outside the inventory area the player will move, but once you tap on inventory area the condition will be FALSE so player will not move.
ImageImageImage
B
27
S
16
G
79
Posts: 1,012
Reputation: 44,243

Post » Sun Sep 20, 2015 9:30 pm

BackendFreak wrote:What I would try in a first attempt is to add to your moving condition something like "AND is not touching inventoryBackground".

EDIT: as InventoryBackground I mean the image you have below your inventory area. In that way you cover whole area as exception. So whenever you touch the screen outside the inventory area the player will move, but once you tap on inventory area the condition will be FALSE so player will not move.




But how do I do that?
B
10
S
1
Posts: 39
Reputation: 588

Post » Mon Sep 21, 2015 6:36 am

Use these 2 conditions in 1 event block:
- On any touch
- On touched object: "inventorybackground".

Then right click on the latter condition and choose "invert".
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Post » Mon Sep 21, 2015 4:01 pm

glerikud wrote:Use these 2 conditions in 1 event block:
- On any touch
- On touched object: "inventorybackground".

Then right click on the latter condition and choose "invert".


Yep, that did the trick. So easy!
Thank you !
B
10
S
1
Posts: 39
Reputation: 588


Return to Construct 2 General

Who is online

Users browsing this forum: disneycom2 and 13 guests