Пример #1
0
        public LoadingScreen()
        {
            Content.InitBasic(GlobalSettings.Default.StartupPath, GameFacade.GraphicsDevice);

            Bg          = new UISimitoneBg();
            Bg.Position = (new Vector2(ScreenWidth, ScreenHeight)) / 2;
            Add(Bg);

            ProgressDiag          = new UIDiagonalStripe(new Point(0, 150), UIDiagonalStripeSide.RIGHT, Color.Black * 0.75f);
            ProgressDiag.Position = new Vector2(0, ScreenHeight / 2 - 75);
            Add(ProgressDiag);

            TextDiag          = new UIDiagonalStripe(new Point(0, 150), UIDiagonalStripeSide.LEFT, Color.Black * 0.5f);
            TextDiag.Position = new Vector2(0, ScreenHeight * 0.75f - 37);
            Add(TextDiag);

            GameFacade.Screens.Tween.To(this, 0.5f, new Dictionary <string, float>()
            {
                { "InterpolatedAnimation", 1f }
            }, TweenQuad.EaseOut);

            LoadProgress          = new UILoadProgress();
            LoadProgress.Position = (new Vector2(ScreenWidth, ScreenHeight) - new Vector2(1012, 128)) / 2;
            Add(LoadProgress);

            Logo          = new UISimitoneLogo();
            Logo.Position = new Vector2(ScreenWidth, ScreenHeight) / 2;
            Add(Logo);
            LogoTween = GameFacade.Screens.Tween.To(Logo, 1f, new Dictionary <string, float>()
            {
                { "Y", ScreenHeight / 4 }, { "ScaleX", 0.5f }, { "ScaleY", 0.5f }
            }, TweenQuad.EaseOut);

            InterpolatedAnimation = InterpolatedAnimation;

            (new Thread(() => {
                VMContext.InitVMConfig(true);
                FSO.Content.Content.Init(GlobalSettings.Default.StartupPath, GameFacade.GraphicsDevice);
                lock (this)
                {
                    LoadingComplete = true;
                }
            })).Start();
        }
Пример #2
0
        public override void OnInitialize()
        {
            _loadProgress = new UILoadProgress {
                Width    = { Percent = 0.8f },
                MaxWidth = UICommon.MaxPanelWidth,
                Height   = { Pixels = 150 },
                HAlign   = 0.5f,
                VAlign   = 0.5f,
                Top      = { Pixels = 10 }
            };
            Append(_loadProgress);

            var cancel = new UITextPanel <string>(Language.GetTextValue("UI.Cancel"), 0.75f, true)
            {
                VAlign = 0.5f,
                HAlign = 0.5f,
                Top    = { Pixels = 170 }
            }.WithFadedMouseOver();

            cancel.OnClick += CancelClick;
            Append(cancel);
        }