hugo_rune
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by hugo_rune
-
-
Yup, maxxes out at 214748 which works, 214749 goes to -214748
-
LOL bit of further info.. 32 bit int length is 2,147,483,647
If you set NewVal to 2,147,483 in the above gsap example, it not only forgets how to count, it goes totally spare and ends up as -1 -
I've been trying to animate a number increment from 0 to 250,000
Interestingly, GSAP 3.0.1, once it gets above 214,000 (ish) it changes the number to a negative and counts down..
When using TweenMax (latest) the code functions as expected.
Here is a codepen of how it should work (using https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js)
See the Pen pooXMNQ by hugoartemisrune (@hugoartemisrune) on CodePen
And here is the identical code that doesn't work (https://cdnjs.cloudflare.com/ajax/libs/gsap/3.0.1/gsap.min.js)
Can anyone shed any light on this matter? I'm mid port to gsap 3 and wasn't quite expecting this behavior
Thanks,
Hugo
for reference, the code in both examples is
var Cont={val:0} , NewVal = 250000 ; TweenLite.to(Cont,1,{val:NewVal,roundProps:"val",onUpdate:function(){ document.getElementById("counter").innerHTML=Cont.val }});
See the Pen MWWMNJL by hugoartemisrune (@hugoartemisrune) on CodePen
GSAP 3.0.1 Arithmetic error
in GSAP
Posted
Thanks OSUblake! I was having fun with that though