Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Grid x:Name="CheatGrid">
- <Grid.Resources>
- <Storyboard x:Name="TransitionCheatOut">
- <DoubleAnimation From="0" To="-200" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="CheatGrid" />
- <DoubleAnimation To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CheatGrid" />
- </Storyboard>
- <Storyboard x:Name="TransitionCheatIn">
- <DoubleAnimation From="200" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="CheatGrid" />
- <DoubleAnimation To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CheatGrid" />
- </Storyboard>
- </Grid.Resources>
- <Grid.RenderTransform>
- <TranslateTransform />
- </Grid.RenderTransform>
- <!-- Insert your current cheat text stuff here --!>
- </Grid>
- // Call to begin transitioning to a new cheat
- private void ShowCheat(int cheatId) {
- Action onTransitionOutComplete = null;
- onTransitionOutComplete = delegate {
- TransitionCheatOut.Complete -= onTransitionOutComplete;
- // Update the text blocks to contain the new cheat text
- TransitionCheatIn.Begin();
- };
- TransitionCheatOut.Complete += onTransitionComplete;
- TransitionCheatOut.Begin();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement