Release of touch

0 favourites
  • 9 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hey guys!

    Just started using construct 2 so in need of some help i'm afraid.

    I've set it so far that when i hold 'down button' a bar increases its width by a scale.

    However i want to set it so that when the button is released it returns back to its initial width.

    Hopefully someone can help me out :).


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yumbie - First, welcome to Scirra and hopefully you'll get a lot of success with Construct 2 (or just C2)! Don't be discouraged that you need help so soon. It's par-for-course when you're learning - there's a LOT to absorb, after all.

    What you're trying to do seems simple enough in concept, but could you provide a .capx file so we can see what you have already?

    (If you don't know how to save your game as a .capx, we can help. No worries. You'll also need a file sharing/storing account with services like DropBox or SugarSync...most people here use DropBox, but I'm very fond of SugarSync - both are great sites.)

  • Rhindon Hey thanks for the fast reply. Um I can take a screen shot of the event sheet.

    Actually uploaded my capx file. Hopefully its all sweet from here

    Thanks for helping me out!

  • Rhindon Hey thanks for the fast reply. Um I can take a screen shot of the event sheet.

    Actually uploaded my capx file. Hopefully its all sweet from here

    Thanks for helping me out!

  • The below image shows a good way to go about this:

    <img src="" border="0" />

    Explanation time!

    The first condition shows a standard "Is touching object" event, but inverted. This means that if the object is not being touched, then the condition will be true. To invert a condition, right click on it and press invert.

    The second condition indicates that if the condition(s) above it are true, then the event will only run the first time that the conditions are true - however, if the conditions become false and then return to true, the event will run again.

    Initialwidth simply implies the initial width that the object took.

    Basically, it boils down to this: the first time the button isn't being touched, change the width of the object to the original.

    I hope this helps you out.

  • What linkman2004 said. :)

  • Rhindon linkman2004 Hey Thanks guys it worked!!! aw yisssssssssssss

    Appreciate the help. im on the road to viridian city oo~

    I now know what lies beyond the horizons of this forum.

    Btw linkman2004 Nichijou rocks! so funny

  • I know this has already been solved, but I'd like to suggest also a Condition in the touch object called "On Touched Object". This only performs actions when the user has just touched the screen in contact with an object.

  • Well, actually, I didn't do much - I'm still learning MUCH about C2, too, and am not focusing on smartphone apps right now.

    Though it's ALWAYS a good idea to include a .capx file. Personally, I have a folder for my games set up specifically for .capx files that I need to share for feedback and help. What I do is name the instance of that file by the game's name, a dash, then a BRIEF description of the problem I'm trying to solve. (For instance, my game's name is "Mr Stick", and I'm having trouble getting him to run one way, then have the animation change to match his change in direction when I go to the left. The .capx file name would be something like MrStick-RunDirectionAnimationChange.) This is all to help with organization.

    Not sure just how deep you've already gotten with C2, but I ALSO recommend you save after virtually EVERY edit...every little change. The reason is because if C2 crashes or some other problem interrupts your progress, it's going to be fury-flaming-eyeballs when you get something to work and lose it all suddenly - it's happened to me!

    Hope that all helps keep things running smoothly!

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