Touch Pushing and Releasing Issue
yna205@nyu.edu
Member Posts: 49
I've made a button for my screen. Whenever I press it, it does as I want it to; it interpolates. And when I release the button it interpolates and shrinks-- just as I want it to.
But there's an issue, whenever I push the button and swipe my finger off the actor (button) while keeping my finger on the screen, it doesn't do anything; it doesn't do as my touch release rule says and that's an issue for me. If I were too move my finger off the button while pressing it using the touch rule, I want the button to go back to its original size. It just seems very glitchy to me that it does that.
Comments
Use when touch is inside
Fortuna Infortuna Forti Una
But then it interpolates and just grows bigger in size. I want it so that if I were to press it and swipe my finger off while keeping my finger on the screen that it goes back to its original size. Something like the game dots' menu
Here you go. Look at the rules and notice the otherwise. You can change around the size and time to your liking.
Fortuna Infortuna Forti Una
Wow sweet man. I was doing something so complex. It works. Basically I was setting new attributes and making it so complicated. But your way is so much simpler. Thanks man!
So basically, another newer rule for when touch is outside, change the attribute so
self.Size.Height and self.Size.Width go back to the original size of the actor. But I like your way better, it's smoother when it zooms out and in.
No problem. Its always best to make it the simplest way possible. Too many unnecessary behaviors will end up making your game run slow and buggy.
Fortuna Infortuna Forti Una
Understood. Would you happen to know when I copy paste that code you have in your project to my actor (button) and when I preview it, it automatically shrinks the button as soon as the preview starts? Like I can see it shrink. But in your project it stays the same when it starts
It is always best to redo the code instead of copy paste, it will help you learn it.
The reason why its changing in your game is because you have to change the numbers in the interpolate behavior to correctly match the size you want to achieve. Change the 200 to whatever size you want it to grow to and change the 100 to the size of your actor.
Fortuna Infortuna Forti Una
Yeah, I just did that. But it's not shrinking back to the original size when I bring the mouse back out of the actor. Your actor does that, but mine isn't
http://postimg.org/image/xn8gx3415/
Click the otherwise tab so it shows you the rest of the code.
Fortuna Infortuna Forti Una
Oh wow. Thank you very much. I'm still fairly new to GameSalad. I'm still getting use to it. Learning new things every day. Thanks again man
Okay, so now I'm trying to interpolate the object so if you were to bring your finger backaround without lifting and released your finger from the actor it interpolates the sides to zero in which then the next scene comes up.
I can interpolate the actor to zero and cause it to go to next scene from there. But I can't seem to find a way to interpolate it after moving from my finger off the actor and bringing it back and releasing my finger. I really like how you did that, but trying to add rules for releasing just isn't doing the job.