0 Favourites

Touch screen question!

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

    http://s1308.photobucket.com/user/Nikola_Roginic/media/touch screen_zpsy2suroao.jpg.html

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

  • Construct 3

    Buy Construct 3

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

    Buy 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)