Animations.MainScreen.Initialize C# (CSharp) Method

Initialize() public method

Sets the screen up (UI components, multimedia content, etc.)
public Initialize ( ) : void
return void
        public override void Initialize()
        {
            base.Initialize();

            SetBackground(ResourceManager.CreateImage("bg_mobile"), Adjustment.CENTER);

            lbl = new Label(ResourceManager.CreateImage("cell_car"));
            AddComponent(lbl, Preferences.Width / 2, Preferences.Height / 2);

            anim = Animation.CreateAnimation(20);

            anim.AnimationType = AnimationType.Relative;
            anim.AddKey(new KeyFrame(0, 0.1f));
            anim.AddKey(new KeyFrame(5, 0.5f));
            anim.AddKey(new KeyFrame(10, 0.9f));
            anim.AddKey(new KeyFrame(15, 0.5f));
            anim.AddKey(new KeyFrame(anim.NumFrames - 1, 0.1f));

            anim.IsLooped = true;

            AddAnimation(anim);
            //  anim.Play(lbl);

            anim.KeyEvent += new Animation.AnimationHandler(anim_KeyEvent);
            playStop = new Button("Play/Stop");
            AddComponent(playStop, 100, 200);
            playStop.Released += new Component.ComponentEventHandler(playStop_Released);

            keyEventLabel = new Label("Event Raised!!");
            AddComponent(keyEventLabel, Preferences.Width / 2, 620);
            keyEventLabel.Visible = false;
        }