Exemplo n.º 1
0
 public override void Draw(GameTime gameTime)
 {
     G.Clear(uic.ColorBackground);
     wr.Draw(SB);
     game.mRenderer.BeginPass(G);
     game.mRenderer.Draw(G);
 }
Exemplo n.º 2
0
        public override void Draw(GameTime gameTime)
        {
            G.Clear(Color.Black);

            wr.Draw(SB);

            game.mRenderer.BeginPass(G);
            game.mRenderer.Draw(G);
        }
Exemplo n.º 3
0
        public override void Draw(GameTime gameTime)
        {
            G.Clear(Color.Black);

            wr.Draw(SB);

            game.DrawDevConsole();
            game.DrawMouse();
        }
Exemplo n.º 4
0
        public override void Draw(GameTime gameTime)
        {
            G.Clear(BACK_COLOR);

            // Set Camera Matrices
            fx.VP = camera.View * camera.Projection;

            // Set The Scheme
            fx.CPrimary   = colorScheme.Primary;
            fx.CSecondary = colorScheme.Secondary;
            fx.CTertiary  = colorScheme.Tertiary;

            // Try To Draw The Model
            G.DepthStencilState = DepthStencilState.Default;
            G.RasterizerState   = RasterizerState.CullNone;
            G.BlendState        = BlendState.Opaque;
            lock (drawLock) {
                if (unitModel != null)
                {
                    // Set Up The Textures
                    G.VertexSamplerStates[0] = SamplerState.PointClamp;
                    G.SamplerStates[1]       = SamplerState.LinearClamp;
                    G.SamplerStates[2]       = SamplerState.LinearClamp;
                    fx.SetTextures(G, unitModel.AnimationTexture, unitModel.ModelTexture, unitModel.ColorCodeTexture);

                    unitModel.UpdateInstances(G, GameplayController.IsUnitDead, (u) => { return(true); });
                    unitModel.SetInstances(G);
                    fx.ApplyPassUnit();
                    unitModel.DrawInstances(G);

                    // Cause XNA Is Retarded Like That
                    G.VertexTextures[0]      = null;
                    G.VertexSamplerStates[0] = SamplerState.LinearClamp;
                }
            }

            // Unset Buffers
            G.SetVertexBuffers(null);
            G.Indices = null;

            wr.Draw(SB);
            if (DevConsole.IsActivated)
            {
                game.DrawDevConsole();
            }

            game.mRenderer.BeginPass(G);
            game.mRenderer.Draw(G);
        }
Exemplo n.º 5
0
        public override void Draw(GameTime gameTime)
        {
            G.Clear(Color.Transparent);

            if (wr != null)
            {
                SB.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullNone);
                SB.Draw(tLoad, G.Viewport.Bounds, Color.White);
                if (tip != null)
                {
                    SB.Draw(tPixel, new Rectangle(TIPS_OFFSET, TIPS_OFFSET, G.Viewport.Width - TIPS_OFFSET * 2, TIPS_HEIGHT), COLOR_BACK);
                    SB.DrawString(font, tip, Vector2.One * (TIPS_OFFSET * 2), COLOR_HIGH);
                }
                SB.End();

                wr.Draw(SB);
            }
            else
            {
                int minX = BOUNDS_OFFSET - BAR_WIDTH;
                int maxX = G.Viewport.Bounds.Width - BOUNDS_OFFSET;

                // Calculate Progress Bar
                Rectangle rBar = G.Viewport.Bounds;
                rBar.X      = (int)(percent * (maxX - minX)) + minX;
                rBar.Y      = G.Viewport.Height - BOUNDS_OFFSET - BAR_HEIGHT;
                rBar.Height = BAR_HEIGHT;
                rBar.Width  = BAR_WIDTH;
                if (rBar.Width + rBar.X > maxX)
                {
                    rBar.Width = maxX - rBar.X;
                }
                else if (rBar.X < BOUNDS_OFFSET)
                {
                    rBar.Width = rBar.X + rBar.Width - BOUNDS_OFFSET;
                    rBar.X     = BOUNDS_OFFSET;
                }

                Rectangle rBack = G.Viewport.Bounds;
                rBack.X      = BOUNDS_OFFSET - BACK_SIZE;
                rBack.Y      = G.Viewport.Bounds.Height - BOUNDS_OFFSET - BAR_HEIGHT - BACK_SIZE;
                rBack.Width -= (BOUNDS_OFFSET - BACK_SIZE) * 2;
                rBack.Height = BAR_HEIGHT + BACK_SIZE * 2;

                SB.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullNone);
                // Draw A Background Image
                SB.Draw(tLoad, G.Viewport.Bounds, Color.White);
                // Draw The Progress Bar
                SB.Draw(tPixel, rBack, COLOR_BACK);
                SB.Draw(tPixel, rBar, Color.Lerp(COLOR_LOW, COLOR_HIGH, percent));

                if (tip != null)
                {
                    SB.Draw(tPixel, new Rectangle(TIPS_OFFSET, TIPS_OFFSET, G.Viewport.Width - TIPS_OFFSET * 2, TIPS_HEIGHT), COLOR_BACK);
                    SB.DrawString(font, tip, Vector2.One * (TIPS_OFFSET * 2), COLOR_HIGH);
                }
                SB.End();
            }

            game.DrawMouse();
        }