You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have an expandable panel which has a scissor applied to its Sprite. What I want to do is to animate the scissor height, for which I've created an AnimatedFloat and tried to create a watch function which will update the height of the scissor to animate the mask.
Code looks something like this:
var s:Sprite = // sprite from asset pack;
// s is then added to an Entity as a component
s.scissor = new Rectangle(0,0,100,20);
// creating animated float with the collapsed panel height
var animatedHeight:AnimatedFloat = new AnimatedFloat(20);
_heightListener = animatedHeight.watch(onHeightUpdate);
// then I try to animate the height
animatedHeight.animateTo(100, .15);
function onHeightUpdate(to:Float, from:Float):Void
{
cast(/* get sprite */, Sprite).scissor.height = to;
}
Problem is that onHeightUpdate only gets called once, when the watch() is called. I've looked at the source of both AnimatedFloat and Tween, but everything seems ok there, so most likely I'm missing something. Any thoughts?
The text was updated successfully, but these errors were encountered:
Hi,
I have an expandable panel which has a scissor applied to its Sprite. What I want to do is to animate the scissor height, for which I've created an AnimatedFloat and tried to create a watch function which will update the height of the scissor to animate the mask.
Code looks something like this:
Problem is that
onHeightUpdate
only gets called once, when thewatch()
is called. I've looked at the source of bothAnimatedFloat
andTween
, but everything seems ok there, so most likely I'm missing something. Any thoughts?The text was updated successfully, but these errors were encountered: