Touch screen question!

0 favourites
  • 5 posts
From the Asset Store
Save hours of work by resizing items on your game screens.
  • 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?

  • 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.

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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".

  • 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 !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)