u10int / Kinetic

A flexible tweening library for iOS in Swift similar to GSAP's TweenMax.
MIT License
57 stars 7 forks source link

.from doesn't initialize right away #1

Closed markuswinkler closed 8 years ago

markuswinkler commented 8 years ago

Fantastic engine! Feels like home coming from TweenMax. :+1:

I discovered a small bug. If you have a delay .from waits for the delay before it sets the .from values. Example (sliding in a label):

Kinetic.from(title, duration: 1, options: [.X(-title.bounds.width)]).spring(tension: 70, friction: 15).delay(0.5).play()

Work around:

title.text = ""
Kinetic.from(title, duration: 1, options: [.X(-title.bounds.width)]).spring(tension: 70, friction: 15).delay(0.5).play().onStart { (tween) -> Void in
    self.title.text = "My Title!"
}
u10int commented 8 years ago

@markuswinkler Thanks for the feedback!

Looking at how TweenMax works by default for TweenMax.from, it does indeed set the starting value immediately even if there's a delay for the tween, so I'll make that fix in my library as well as you suggested. TweenMax supports an immediateRender parameter to not set the starting properties until the tween actually starts, but that's probably less often the desired effect: http://greensock.com/docs/#/HTML5/GSAP/TweenMax/from/

markuswinkler commented 8 years ago

Great! Btw, I think your version number of 0.1.0 is ridiculously low. Your library seems very mature and very well done (including great documentation), that's more like a 1.1.0.

u10int commented 8 years ago

Yeah I agree it's probably too low and will be updated to at least 0.9.0 in my next release. I'd like to do more in-depth performance testing on it before marking it as an official 1.0.0 over the next week or so.

u10int commented 8 years ago

Fixed in 0.9.0 I just pushed out.