Esempio n. 1
0
        void InitializeControls()
        {
            Desktop.BackgroundColor = Color.Black;

            var screenOverlay = new Overlay(this)
            {
                Opacity = 1
            };
            var screenOverlayOpacityAnimation = new FloatLerpAnimation
            {
                Action = (current) => { screenOverlay.Opacity = current; },
                From = 1,
                To = 0,
                Duration = TimeSpan.FromSeconds(0.5d),
                Enabled = true
            };
            screenOverlayOpacityAnimation.Completed += (s, e) => screenOverlay.Close();
            screenOverlay.Animations.Add(screenOverlayOpacityAnimation);

            var nowLoadingTextBlock = new TextBlock(this)
            {
                Text = "NOW LOADING...",
                ForegroundColor = Color.White,
                BackgroundColor = Color.Black,
                FontStretch = new Vector2(2),
                Padding = new Thickness(8)
            };
            Desktop.Content = nowLoadingTextBlock;

            screenOverlay.Show();
        }
Esempio n. 2
0
 /// <summary>
 /// インスタンスを生成します。
 /// </summary>
 /// <param name="screen">Screen。</param>
 protected OverlayDialogBase(Screen screen)
     : base(screen)
 {
     Overlay = new Overlay(Screen)
     {
         Owner = this
     };
 }
Esempio n. 3
0
        protected override void Update(GameTime gameTime)
        {
            // LoadedScreen プロパティが null ではなければ、
            // 非同期な Screen のロードが完了しています。
            if (LoadedScreen != null)
            {
                var exitOverlay = new Overlay(this);

                var animation = new FloatLerpAnimation
                {
                    Action = (current) => { exitOverlay.Opacity = current; },
                    To = 1,
                    Duration = TimeSpan.FromSeconds(0.5d),
                    Enabled = true
                };
                animation.Completed += OnExitAnimationCompleted;
                exitOverlay.Animations.Add(animation);

                exitOverlay.Show();
            }

            base.Update(gameTime);
        }
Esempio n. 4
0
        void InitializeControls()
        {
            var firstWindow = new FirstWindow(this);
            firstWindow.Show();

            var secondWindow = new SecondWindow(this);
            secondWindow.Show();

            var thirdWindow = new ThirdWindow(this);
            thirdWindow.Show();

            var startEffectOverlay = new Overlay(this)
            {
                Opacity = 1
            };
            startEffectOverlay.Show();

            var startEffectOverlay_opacityAnimation = new FloatLerpAnimation
            {
                Action = (current) => { startEffectOverlay.Opacity = current; },
                From = 1,
                To = 0,
                Duration = TimeSpan.FromSeconds(0.5d),
                Enabled = true
            };
            startEffectOverlay_opacityAnimation.Completed += (s, e) =>
            {
                startEffectOverlay.Close();
                thirdWindow.Activate();
            };
            startEffectOverlay.Animations.Add(startEffectOverlay_opacityAnimation);
        }
Esempio n. 5
0
            void OnSwitchScreenButtonClick(Control sender, ref RoutedEventContext context)
            {
                var overlay = new Overlay(Screen)
                {
                    Opacity = 0,
                    BackgroundColor = Color.Black
                };
                overlay.Show();

                var opacityAnimation = new FloatLerpAnimation
                {
                    Action = (current) => { overlay.Opacity = current; },
                    To = 1,
                    Duration = TimeSpan.FromSeconds(0.5d),
                    Enabled = true
                };
                opacityAnimation.Completed += (s, e) =>
                {
                    Screen.ShowScreen("MainMenuDemoScreen");
                };
                Animations.Add(opacityAnimation);
            }
Esempio n. 6
0
            void OnSwitchScreenButtonClick(Control sender, ref RoutedEventContext context)
            {
                var overlay = new Overlay(Screen);
                overlay.Show();

                var opacityAnimation = new FloatLerpAnimation
                {
                    Action = (current) => { overlay.Opacity = current; },
                    To = 1,
                    Duration = TimeSpan.FromSeconds(0.5d),
                    Enabled = true
                };
                opacityAnimation.Completed += (s, e) =>
                {
                    var uiService = Screen.Game.Services.GetRequiredService<IUIService>();
                    uiService.Show("WindowDemoScreen");
                };
                Animations.Add(opacityAnimation);
            }
Esempio n. 7
0
            void OnExitButtonClick(Control sender, ref RoutedEventContext context)
            {
                var overlay = new Overlay(Screen);
                overlay.Show();

                var opacityAnimation = new FloatLerpAnimation
                {
                    Action = (current) => { overlay.Opacity = current; },
                    To = 1,
                    Duration = TimeSpan.FromSeconds(0.5d),
                    Enabled = true
                };
                opacityAnimation.Completed += (s, e) => Screen.Game.Exit();
                Animations.Add(opacityAnimation);
            }