예제 #1
0
        private static void DrawMisc(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Textures.GetTexture("Cursor"), new Vector2((float)InputManager.Mousestate[0].X, (float)InputManager.Mousestate[0].Y), null, Color.White, 0f, Vector2.Zero, 1f, 0, 1f);
            if (InputBox.Active)
            {
                InputBox.Draw(spriteBatch);
            }
            if (MessageBox.GameMessage != null)
            {
                MessageBox.GameMessage.Draw(spriteBatch, false);
            }
            if (MessageBox.StatusMessage != null)
            {
                MessageBox.StatusMessage.Draw(spriteBatch, true);
            }
            if (PConsole.Active)
            {
                PConsole.Draw(spriteBatch);
            }

            if (LabelList != null)
            {
                if (SelectedEntity != -1 && !ScreenManager.Paused)
                {
                    foreach (TextSprite ts in LabelList)
                    {
                        spriteBatch.DrawString(ts.Spritefont, ts.Text, ts.Position, ts.Colour, 0f, Vector2.Zero, 1f, 0, 0.999f);
                    }

                    Button.DrawAll(spriteBatch);
                    TextSprite.DrawAll(spriteBatch);
                }
            }
        }
예제 #2
0
        public static void EditorControls()
        {
            if (!ScreenManager.Paused)
            {
                if (!PConsole.Active)
                {
                    if (Keystate[0].IsKeyDown(Keys.W) || Keystate[0].IsKeyDown(Keys.Up))
                    {
                        PPlayer.Player.sqobject.Position += (Vector2)(new Vector2(0f, -10f) * PPlayer.Player.sqobject.Velocity.X);
                    }
                    if (Keystate[0].IsKeyDown(Keys.A) || Keystate[0].IsKeyDown(Keys.Left))
                    {
                        PPlayer.Player.sqobject.Position += (Vector2)(new Vector2(-10f, 0f) * PPlayer.Player.sqobject.Velocity.X);
                    }
                    if (Keystate[0].IsKeyDown(Keys.S) || Keystate[0].IsKeyDown(Keys.Down))
                    {
                        PPlayer.Player.sqobject.Position += (Vector2)(new Vector2(0f, 10f) * PPlayer.Player.sqobject.Velocity.X);
                    }
                    if (Keystate[0].IsKeyDown(Keys.D) || Keystate[0].IsKeyDown(Keys.Right))
                    {
                        PPlayer.Player.sqobject.Position += (Vector2)(new Vector2(10f, 0f) * PPlayer.Player.sqobject.Velocity.X);
                    }
                    if (JustPressed(Keys.P))
                    {
                        SquareObject[,] sq = SquareObject.sqObjectArray;
                        for (int x = sq.GetLowerBound(0); x < sq.GetLength(0); x++)
                        {
                            for (int y = 1; y < sq.GetLength(1); y++)
                            {
                                if ((sq[x, y] != null) && (sq[x, y].texturename == "A"))
                                {
                                    PPlayer.Player.sqobject.Position = sq[x, y].Position;
                                }
                            }
                        }
                    }
                    if (JustPressed(Keys.Enter))
                    {
                        PConsole.Activate();
                    }
                    if (Keystate[0].IsKeyDown(Keys.L))
                    {
                        PPlayer.Player.sqobject.Velocity = new Vector2(5f, PPlayer.Player.sqobject.Velocity.Y);
                    }
                    if (Keystate[0].IsKeyDown(Keys.K))
                    {
                        PPlayer.Player.sqobject.Velocity = new Vector2(2f, PPlayer.Player.sqobject.Velocity.Y);
                    }
                }
                else
                {
                    PConsole.Update();

                    if (JustPressed(Keys.Enter))
                    {
                        PConsole.CheckCommands();
                        PConsole.Deactivate();
                    }
                }
            }
        }