Exemplo n.º 1
0
        public StartupLoadingScene()
            : base()
        {
            NextSceneType = typeof(TitleScene);
            ClearColour = Color.White;

            _progressGaugeSpinner = null;
        }
Exemplo n.º 2
0
        private void SetupProgressGauge()
        {
            float progressGaugeLeftEdge = Definitions.Back_Buffer_Center.X - (Progress_Gauge_Total_Width / 2);
            float spinnerRadius = TextureManager.Textures [Spinner_Texture].Width / 2.0f;

            _progressGaugeSpinner = new DisposableSimpleDrawableObject ()
            {
                Texture = TextureManager.Textures[Spinner_Texture],
                Frame = TextureManager.Textures[Spinner_Texture].Bounds,
                Origin = new Vector2(spinnerRadius, spinnerRadius),
                RenderLayer = 2,
                Visible = true
            };

            _progressGaugeSpinner.WorldPosition = new Vector2(progressGaugeLeftEdge + spinnerRadius, Progress_Gauge_Center_Y);
            RegisterGameObject(_progressGaugeSpinner);

            Vector2 progressBarContainerTopLeft = new Vector2(
                progressGaugeLeftEdge + ((spinnerRadius * 2.0f) + Progress_Container_Margin),
                Progress_Gauge_Center_Y - ((Progress_Bar_Height / 2.0f) + Progress_Container_Margin));

            Point progressBarContainerDimensions = new Point(
                Progress_Gauge_Total_Width - (int)((spinnerRadius * 2.0f) + Progress_Container_Margin),
                Progress_Bar_Height + (Progress_Container_Margin * 2));

            RegisterGameObject(
                new Box()
                {
                    Position = progressBarContainerTopLeft,
                    Dimensions = progressBarContainerDimensions,
                    EdgeTexture = TextureManager.Textures[Pixel_Texture],
                    EdgeTint = Color.CornflowerBlue,
                    BackgroundTexture = TextureManager.Textures[Pixel_Texture],
                    BackgroundTint = Color.White,
                    RenderLayer = 4,
                    Visible = true
                });

            _progressBarX = (int)progressBarContainerTopLeft.X + Progress_Container_Margin;
            _progressBarY = (int)progressBarContainerTopLeft.Y + Progress_Container_Margin;
            _progressBarWidth = progressBarContainerDimensions.X - (Progress_Container_Margin * 2);
        }