示例#1
0
        internal static void Draw()
        {
            MDraw.Begin();
            //Root.Draw();
            //StateManager.Draw();
            MDraw.End();

            MDraw.Test();
        }
        public override void Draw(GameTime t)
        {
            if (!Visible)
            {
                return;
            }

            MDraw.Begin();

            MDraw.Write("Rebind Input Source Layout", new Vector2(20f, 20f), Color.White);

            float leftPos = 50f;
            float x1      = 400f;
            float x2      = 600f;
            float shift   = 5f;
            var   pos     = new Vector2(0, 90f);
            Color color;

            pos.X = x1;
            MDraw.Write("Player 1", pos, Color.White);

            pos.X = x2;
            MDraw.Write("Player 2", pos, Color.White);

            pos.X  = leftPos;
            pos.Y += 80f;

            if (SelectionIndex == 0)
            {
                pos.X += shift;
            }
            color = SelectionIndex == 0 ? Color.Yellow : Color.White;
            MDraw.Write("Swap Keyboard", pos, color);

            pos.X = Toggles.keyboardIsPlayer2 ? x2 : x1;
            MDraw.Write("Keyboard", pos, color);

            pos.X  = leftPos;
            pos.Y += 60f;

            color = SelectionIndex == 1 ? Color.Yellow : Color.White;
            if (SelectionIndex == 1)
            {
                pos.X += shift;
            }
            MDraw.Write("Swap Gamepad", pos, color);

            pos.X = Toggles.gamepad1IsPlayer2 ? x2 : x1;
            MDraw.Write("Gamepad1", pos, color);

            pos.X = Toggles.gamepad1IsPlayer2 ? x1 : x2;
            MDraw.Write("Gamepad2", pos, color);

            MDraw.End();
        }
        public override void Draw(GameTime t)
        {
            if (!Visible)
            {
                return;
            }

            MDraw.Begin();

            var   pos        = new Vector2(20f, 20f);
            float firstSpace = 150;
            float inputSpace = 200;

            MDraw.Write("Rebind Panel: Keyboard", pos, Color.White);
            pos.X  = Screen.Width * 0.2f;
            pos.Y += 40f;
            MDraw.Write("User", new Vector2(pos.X + firstSpace, pos.Y), Color.White);
            MDraw.Write("Default", new Vector2(pos.X + firstSpace + inputSpace, pos.Y), Color.White);

            pos.Y += 60f;

            for (int i = 0; i < MaxButtons; i++)
            {
                bool  active = SelectionIndex == i;
                Color color  = active ? (IsEditingKeyboard ? Color.Lime : Color.Yellow) : (IsEditingKeyboard ? Color.Gray : Color.White);

                Vector2 rowPos = pos.Clone();

                if (active)
                {
                    rowPos.X += 5f;
                }

                MDraw.Write(InputManager.SourceKeyboard.AllButtons[i].Name, rowPos, color);

                rowPos.X += firstSpace;
                var kb = InputManager.SourceKeyboard.AllButtons[i];
                if (kb.UserKey != null)
                {
                    MDraw.Write(kb.UserKey.ToString(), rowPos, color);
                }

                rowPos.X += inputSpace;
                if (kb.HardcodedKey != null)
                {
                    MDraw.Write(kb.HardcodedKey.ToString(), rowPos, color);
                }

                pos.Y += 40f;
            }

            MDraw.SpriteBatch.End();
        }
        public static void Draw()
        {
            MDraw.Begin();

            foreach (var rb in AllRigidbodies)
            {
                // draw velocity
                MDraw.DrawLine(rb.Entity.Position, rb.Entity.Position + rb.Velocity / Time.DeltaTime, Color.Gray);
                MDraw.DrawPoint(rb.Entity.Position + rb.Velocity / Time.DeltaTime, Color.Gray);
            }

            MDraw.End();
        }
示例#5
0
        public override void Draw(GameTime t)
        {
            if (!Visible)
            {
                return;
            }

            MDraw.Begin();

            var   pos        = new Vector2(20f, 20f);
            float firstSpace = 150;

            var title = string.Format("Rebind Panel: Gamepad {0}", Index == PlayerIndex.One ? "1" : "2");

            MDraw.Write(title, pos, Color.White);
            pos.X  = Screen.Width * 0.2f;
            pos.Y += 40f;
            MDraw.Write("User", new Vector2(pos.X + firstSpace, pos.Y), Color.White);

            pos.Y += 60f;

            for (int i = 0; i < MaxButtons; i++)
            {
                bool  active    = SelectionIndex == i;
                var   rowTarget = Source.AllButtons[i];
                Color color     = rowTarget.IsRebindable ? (active ? Color.Yellow : Color.White) : (active ? new Color(150, 150, 80) : Color.Gray);

                Vector2 rowPos = pos.Clone();

                if (active)
                {
                    rowPos.X += 5f;
                }

                MDraw.Write(rowTarget.Name, rowPos, color);

                rowPos.X += firstSpace;
                if (rowTarget.ButtonList.Count > 0)
                {
                    MDraw.Write(rowTarget.ButtonList.ToPrettyString(), rowPos, color);
                }

                pos.Y += 40f;
            }

            MDraw.Write(string.Format("Rumble: {0} (press F7)", Source.RumbleEnabled ? "ON" : "OFF"), new Vector2(20f, Screen.Height - 40f), Color.DimGray);

            MDraw.SpriteBatch.End();
        }