Animation Help

triton13triton13 Member Posts: 161
edited February 2012 in Working with GS (Mac)
Hey everyone, I'm new to this program and I need a little bit of help. I have this animation and I need to have it controlled by touch as someone is dragging it down. The best way to describe this is, the unlock slider on iPhones. How you slide it across the screen and if you stop the slider stops and if you go back, the slider goes back. I would be doing something very similar to that but I will be dragging downwards and it will be with various pictures, not just a slider bar with an arrow on it that looks the same as it's sliding.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2012
    I haven't tried it, but I think you can accomplish this by constraining either the y position of your slider actor to the mouse position y while touch is pressed and then using a Move To or interpolate behavior to return the slider to its initial position when touch is released. With regard to the animation, is it a constant animation or do you need it to be related to how far/fast the slider is moved?

    Edit: This worked for me: http://img543.imageshack.us/img543/2434/screenshot20120201at219.jpg (the only other thing I added was an actor attribute called InitialY which is a real set to 0). After further testing, this only works if the mouse/touch is released on top of the actor. I changed the second rule to when mouse button is up and it works correctly now.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • triton13triton13 Member Posts: 161
    The animation would be the user pulling something down and by the time it gets to the bottom the thing they pull down is gone. I would like to be able the user to control how fast this object moves when it's pulled down. I don't want them to start pulling it and it moves at it's own pace. You know what I mean?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    So the "animation" could be done using a second actor that either replicates or changes its width based on the y position of the first actor (or the y position of the mouse). If I have a chance, I'll make a sample for you.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I'm having a little trouble getting the math to work, but here's the file: http://www.mediafire.com/?c0b42o64pwnblxj. You'll notice that I turned off the Height Formula constrain behavior because it was shrinking the actor too quickly, but my debugging text works (the intended height of the actor is displayed within the actor while you drag it). Maybe someone else can shed some light on this.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited February 2012
    You don't need an animation. Use the drag and drop method on an actor and constrain it's X&Y to the area you want. Here is a video on the drag an actor on touch method.

  • triton13triton13 Member Posts: 161
    Thank you very much guys, if I have anymore questions I'll be posting. I'm just glad this forum is friendly because with a lot of other forums they would be yelling at me by now. Thank you =)
Sign In or Register to comment.