示例#1
0
        protected override void _Draw(Renderer2D renderer)
        {
            renderer.DrawFilledRectangle(new Rectangle(AbsoluteX, AbsoluteY, Width, Height), Color.LightCoral);
            switch (Orientation)
            {
            case Orientation.Vertical:
                renderer.DrawFilledRectangle(new Rectangle(AbsoluteX, (int)(AbsoluteY + RenderHeight * ValuePercent - 0.2f * Height), Width, (int)(0.2f * Height)), Color.Coral);
                break;

            case Orientation.Horizontal:
                renderer.DrawFilledRectangle(new Rectangle((int)(AbsoluteX + RenderWidth * ValuePercent), AbsoluteY, (int)(0.2f * (Width - 0.2f * Width)), Height), Color.Coral);
                break;

            default:
                throw new NotImplementedException();
            }
        }
示例#2
0
 public void Draw(Renderer2D renderer)
 {
     if (!Visible)
     {
         return;
     }
     renderer.DrawFilledRectangle(new Rectangle(AbsoluteX, AbsoluteY, Width, Height), Background);
     _Draw(renderer);
 }
示例#3
0
 public void Draw(Renderer2D renderer, GameTime time)
 {
     renderer.DrawFilledRectangle(new Rectangle((int)nPC.Position.X, (int)nPC.Position.Y, (int)nPC.Size.X, (int)nPC.Size.Y), color);
     if (ShowVelocity.HasValue)
     {
         renderer.DrawVector(nPC.Velocity, nPC.Center, ShowVelocity.Value, 2);
     }
     if (ShowAcceleration.HasValue)
     {
         renderer.DrawVector(nPC.Acceleration, nPC.Center, ShowAcceleration.Value, 1);
     }
 }
示例#4
0
        protected override void _Draw(Renderer2D renderer)
        {
            input.Draw(renderer);
            label.Draw(renderer);
            if (GameConsole.WaitingMessages > 0)
            {
                waitingMessages.Content = "(" + GameConsole.WaitingMessages + ") Messages waiting. Press Enter to continue";
                waitingMessages.Draw(renderer);
            }
            int yDif = input.Font.PixelHeight;

            foreach (var msg in GameConsole.MessagesToPrint())
            {
                if (msg.HasBackground)
                {
                    renderer.DrawFilledRectangle(new Rectangle(AbsoluteX, AbsoluteY + yDif, Width, Font.CourierNew14.PixelHeight), msg.BackgroundColor);
                }
                renderer.Draw(Font.CourierNew14, msg.Message, new Vector2(AbsoluteX, AbsoluteY + yDif), msg.Color);
                yDif += Font.CourierNew14.PixelHeight;
            }
        }
示例#5
0
 public void Draw(Renderer2D renderer, GameTime time)
 {
     renderer.DrawCircle(circle, color, thickness);
     renderer.DrawFilledRectangle(new Rectangle(circle.Center.X - 5, circle.Center.Y - 5, 10, 10), color);
 }