Exemple #1
0
 private void button5_Click(object sender, EventArgs e)
 {
     if (listBox1.SelectedIndex != -1)
     {
         HitboxEditor.Start((listBox1.SelectedItem as BaseSprite), (listBox1.SelectedItem as BaseSprite).spriteGameSize.Width, (listBox1.SelectedItem as BaseSprite).spriteGameSize.Height);
     }
 }
Exemple #2
0
        private void HitboxEditorControls(GameTime gt, Vector2 editorCursorPos)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.S))
            {
                HitboxEditor.cameraPosition.Y -= 3;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.W))
            {
                HitboxEditor.cameraPosition.Y += 3;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.A))
            {
                HitboxEditor.cameraPosition.X += 3;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.D))
            {
                HitboxEditor.cameraPosition.X -= 3;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Up) && HitboxEditor.heightHB != HitboxEditor.hitboxHeight)
            {
                HitboxEditor.heightHB++;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Down) && HitboxEditor.heightHB > 1)
            {
                HitboxEditor.heightHB--;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Left) && HitboxEditor.widthHB > 1)
            {
                HitboxEditor.widthHB--;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Right) && HitboxEditor.widthHB != HitboxEditor.hitboxWidth)
            {
                HitboxEditor.widthHB++;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                HitboxEditor.bIsRunning       = false;
                KeyboardMouseUtility.bPressed = true;
            }

            if (Mouse.GetState().LeftButton == ButtonState.Pressed && MapBuilder.mainG.IsActive)
            {
                HitboxEditor.LMBFunction();
            }

            if (Mouse.GetState().RightButton == ButtonState.Pressed && MapBuilder.mainG.IsActive)
            {
                HitboxEditor.RMBFunction();
            }
        }