Animation not working

  1. 5 years ago

    apt

    17 Jun 2018 User since 2018
    Edited 5 years ago by apt

    I'm trying out the Animation feature and from the Animation overview you simple drag an object into the Animation timeline, but when I do this nothing happens. nothing appears in the timeline. Tried with entire object, tried with the object connector... nothing.

    What am I missing?

  2. marco

    18 Jun 2018 Administrator User since 2016

    Animation should work fine, please try to look at the HeartRate tutorial (you can skip the bluetooth path), starting from step 9 it shows you how to create an animation:
    https://docs.creolabs.com/tutorials/heart-rate.html

    Please let me know if you need further assistance.

  3. apt

    18 Jun 2018 User since 2018

    Followed guide and working but receiving a crash when attaching to an action. Sent the crash log

  4. andrea

    18 Jun 2018 Administrator User since 2016

    I'm looking at your crash report, I'll let you know as soon as possible.

  5. andrea

    18 Jun 2018 Administrator User since 2016

    Hi @apt, could you please send me a simple project to be able to reproduce the crash?

  6. andrea

    18 Jun 2018 Administrator User since 2016

    Hi @apt, I was able to reproduce the crash with the event panel of the inspector. I've found a last minute issue with that panel, the fix will be released in the next update. In the meantime, you can call your animation programmatically with the following code in the DidShow event of your Window (see the attached image):

    Animation1.play()

    Thank you for your feedback.

  7. apt

    18 Jun 2018 User since 2018

    Thats great, I was just about to post the the problem file (unable to attach a Creo file to a crash report), I was able to reproduce it with a new project too. I'd be happy to test any fixes.

    At the moment I'm still playing around with Creo so don't have any particular need to using an animation at this point.

    I was a little confused about the animation process, there seems to be a lot of steps involved to even get to the point of starting to animate properties.

  8. marco

    20 Jun 2018 Administrator User since 2016

    @apt it is far easier to use the animate method:

    func animate(duration: Float, delay: Float, options: AnimationOption, closure: Closure, completion: Closure)

    available in any View.

    I attached a sample project to show you how to use that method.

  9. apt

    20 Jun 2018 User since 2018
    Edited 5 years ago by apt

    But is that to actually trigger the animation?. The issues I have are the creation of animations. I will give it a look later however, thanks.

  10. apt

    20 Jun 2018 User since 2018

    Ok that makes sense now, what I don't understand from the example is how is the 'Press Me' label being controlled when there is no reference to it in the code. The animation It being applied explicitly to 'OvalShape1' from what I can see and not the container 'View1'.

  11. andrea

    20 Jun 2018 Administrator User since 2016
    Edited 5 years ago by andrea

    @apt,
    the code of the animation is:

    var f = self.frame.copy();
    f.width += 20;
    f.height += 20;
    self.frame = f;
    self.rotationAngle += 5;

    where self is the View1, because this code is written inside an event of the View1, even if the closure is added to an animate method of the OvalShape1:

    OvalShape1.animate(0.5, 0.2, 0, {
    	var f = self.frame.copy();
    	f.width += 20;
    	f.height += 20;
    	self.frame = f;
    	self.rotationAngle += 5;
    }, null);

    So the animation change the frame and the rotation angle of the View1 and the frame of its subviews (OvalShape1 and Label1) changes according to the Autosize constraints of each subview.

or Sign Up to reply!