Replaying a Storyboard
Posted: 18 Dec 2013, 02:48
Looking through WPF discussions it seems the recommended way to replay a Storyboard is to use the Seek function to reset it to the beginning, though this function is not supported in Noesis. I have a simple Storyboard which I play based on certain events in my game:
When it plays the first time it is correct. But subsequent times it appears to play very slowly, but still ends 2 seconds in. How can I properly reset this Storyboard to the beginning state and replay it without using Seek?
Code: Select all
<Storyboard x:Name="bluewarninganim">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="bluewarningimage">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.9" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="bluewarningimage">
<EasingDoubleKeyFrame KeyTime="0:0:1.9" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>