Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Cozz
Posts: 112
Registered: ‎10-10-2010
My Device: Torch
Accepted Solution

RotateTransition. How continue animation

 RotateTransition {

                    id: rotateAnimationTurn

                    fromAngleZ: 0

                    toAngleZ: 90

                    duration: 1000

                    }  

 

I'm playing with this image animation but I have no idea how to continue the animation. Say if the button is pressed again. It starts over a 0 and ends at 90 degrees again. How can I get it to know it's current position and continue to go another 90 degress when the button is pressed again? 

 

 

______________________________________________
Android dev jumping ship to BB. Cascade newbie. Any help would be great. Miss the Visual Basic days.

Updated my pin
Please use plain text.
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: RotateTransition. How continue animation

[ Edited ]

here's an example i was using to rotate an arrow by 90, pause, another 90 & stop until clicked again where it does the same thing backwards

 

 

animations: [
       RotateTransition {
            id: scrollContainer1ArrowDown
            fromAngleZ: 360
            toAngleZ: 270
            duration: 100
            onEnded: {
                scrollContainer1ArrowDownHalf.play();
            }
},
       RotateTransition {
              id: scrollContainer1ArrowDownHalf
              fromAngleZ: 270
              toAngleZ: 180
              duration: 100
},
RotateTransition {
             id: scrollContainer1ArrowUp
             fromAngleZ: 180
             toAngleZ: 270
             duration: 100
             onEnded: {
scrollContainer1ArrowUpHalf.play(); } }, RotateTransition { id: scrollContainer1ArrowUpHalf fromAngleZ: 270 toAngleZ: 360 duration: 100 onStarted: { } } ]

 to use

Container {
   id: animator
   property wasClicked
   onClicked: {
      if (!wasClicked){
          scrollContainer1ArrowDown.play();
          animator.wasClicked = true;
      } else {
          scrollContainer1ArrowUp.play();
          animator.wasClicked = false;
      }
   }
}

 

Please use plain text.