SOLVED:How do I turn this mouse inventory system into touch?

0 favourites
  • 6 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • It is made with mouse in mind, but I've worked on this for 24 hours now and can't figure it out. It isn't mine, I found it in at some point a week ago while shuffling through tutorials and forum postings.

    Please, someone take a look at this and help a poor sap! Yes, I know there are some things I cannot do with touch, but basic moving things around and equipping things is all I need. The stats display I'll handle my own way.

    Thanks again in advance!

    EDIT: This is the raw version of the Inventory system I found somewhere on the forums or tutorials. I've already, in a copy of this file, added the Touch object and translated everything, but it doesn't work as one imagines it should. That part of translating took about 10 minutes, but I've spend the last 23 hours and 50 minutes trying to get it working but to no avail.

  • Double click like were u go to to add a sprite but scroll down to touch its like mouse but it says touch

  • No, I understand that part, I just uploaded the raw version of the CAPX without the Touch object. I've worked _with_ the Touch object trying to get everything working properly and it isn't translating correctly and I can't figure out why for the life of me.

  • Try makig a new project and just re do everything in a new one probly just a bug

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think it has to do with clicking the object, dragging it, and it's supposed to store the UID of the slot, but it doesn't or something like that. I wish I had more info, but my main post is really all I can say about it.

  • SOLUTION 100% working so far as I can tell:

    Add a 1x1 sprite, name it CursorLoc, Visibility at start: Invisible.

    Add two lines of code beneath the globals, before anything else (in this order, too, since it is picky):

    Touch is in touch: set position to (Touch.X, Touch.Y)

    Touch on any touch start: set position to (Touch.X, Touch.Y)


    "Cursor is over invSlot" with "CursorLoc is overlapping invSlot" (etc, equipSlot as well)

    "Mouse Left Button is NOT down" with "Touch is NOT in touch"

    "Click on Item" replace with "Touch on touch object Item"

    Replace all actions where "Mouse.X" or "Mouse.Y" are with "Touch.X" and "Touch.Y". (These are mixed in with algorithms, just change the Mouse to Touch)

    EDIT: In order for the stats to work (see "STATS" group of events), just change it to "Touch Is in touch" instead of "Mouse Left button is NOT down". This works almost as needed: it displays the stats while dragging the item about. If you drag an item and hover over an equipped item it will display the stats of the lesser item if it's equipped (as expected). Moving a lesser item over a more powerful item only displays the lesser item's stats. The desired goal is to have the stats of a more powerful item over it instead. This isn't necessary for me as stats will all be displayed elsewhere, but if you need it, know that this bug is there.


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