2 using System.Collections.Generic;
6 namespace NUIBrokerSample
8 class ObjectAnimationManager
10 private XamlPage xamlPage;
11 private Position defaultPosition = new Position(0, 0);
13 public ObjectAnimationManager(XamlPage xamlPage)
15 this.xamlPage = xamlPage;
18 public void StartIconAnimationByDirection(bool direction)
22 xamlPage.mainView.Hide();
23 xamlPage.picture.Hide();
24 defaultPosition = xamlPage.mainViewModel.MainPosition;
26 Animation ani = new Animation(500);
27 ani.DefaultAlphaFunction = GetSineInOut80();
28 ani.AnimateTo(xamlPage.IconView, "Position", new Position(0, 150));
29 ani.AnimateTo(xamlPage.AddView, "Position", new Position(30, 180));
31 ani.AnimateTo(xamlPage.IconView, "Scale", new Vector3(1.3f, 1.3f, 1.3f));
32 ani.AnimateTo(xamlPage.AddView, "Scale", new Vector3(0.5f, 0.5f, 0.5f));
34 ani.AnimateTo(xamlPage.MainProfileText, "Position", new Position(0, 220));
36 ani.AnimateTo(xamlPage.AnimationView, "Size", new Size(Window.Instance.WindowSize));
37 ani.AnimateTo(xamlPage.AnimationView, "Position", new Position(0, 0));
39 ani.AnimateTo(xamlPage.cinematicText, "Position", new Position(0, 320));
48 xamlPage.mainView.Show();
49 xamlPage.picture.Show();
51 Animation ani = new Animation(endTime);
52 ani.DefaultAlphaFunction = GetSineInOut80();
53 ani.AnimateTo(xamlPage.IconView, "Position", new Position(-160, 80), startTime, endTime);
54 ani.AnimateTo(xamlPage.AddView, "Position", new Position(160, 80), startTime, endTime);
56 ani.AnimateTo(xamlPage.IconView, "Scale", new Vector3(1.0f, 1.0f, 1.0f), startTime, endTime);
57 ani.AnimateTo(xamlPage.AddView, "Scale", new Vector3(1.0f, 1.0f, 1.0f), startTime, endTime);
59 ani.AnimateTo(xamlPage.MainProfileText, "Position", new Position(0, 60), startTime, endTime);
61 ani.AnimateTo(xamlPage.AnimationView, "Size", new Size(470, 600), startTime, endTime);
62 ani.AnimateTo(xamlPage.AnimationView, "Position", defaultPosition);
64 ani.AnimateTo(xamlPage.cinematicText, "Position", new Position(0, 150));
72 private AlphaFunction GetSineInOut80()
74 return new AlphaFunction(new Vector2(0.45f, 0.43f), new Vector2(0.41f, 1.0f));