Exemple #1
0
        public override void Draw()
        {
            // Redraw the display
            RedrawDisplay();

            // Perform the next block of code 10 times
            for (int i = 0; i < sprites; i++)
            {
                // Assign random values to each of these variable
                charID  = random.Next(32, 126);
                x       = random.Next(0, display.X);
                y       = random.Next(32, display.Y);
                colorID = random.Next(1, 15);

                // Draw a random character at a random position on the screen with a random color
                DrawText(Convert.ToChar(charID).ToString(), x, y, DrawMode.Sprite, "large", colorID);
            }

            // Draw the total number sprite on the display
            DrawText(CurrentSprites.ToString(), 15, 2, DrawMode.Tile, "large", 15);
        }
Exemple #2
0
        private void KeyboardShortcuts()
        {
            if (InputManager.ReceivingInput != null)
            {
                return;
            }

            #region Move the Camera

            InputManager.Keyboard.ControlPositionedObject(SpriteManager.Camera);

            #endregion

            #region toolbar hotkeys


            if (InputManager.Keyboard.KeyPushed(Keys.Delete))
            {
                if (this.mCurrentKeyframe != null)
                {
                    this.mCurrentKeyframeList.Remove(mCurrentKeyframe);

                    GuiData.ListBoxWindow.InstructionSetListBox.RemoveHighlightedItems();

                    CurrentKeyframe = null;
                }
                else if (this.mCurrentKeyframeList != null && CurrentInstructionSet != null)
                {
                    GuiData.ListBoxWindow.InstructionSetListBox.RemoveItemAndChildren(mCurrentKeyframeList);

                    CurrentInstructionSet.Remove(mCurrentKeyframeList);

                    CurrentKeyframeList = null;
                }
            }
            if (InputManager.Keyboard.KeyPushed(Keys.K))
            {
                GuiData.TimeLineWindow.insertKeyframeButton.OnClick();
            }

            if (InputManager.Keyboard.ControlCPushed())
            {
                GuiData.ToolsWindow.CopyButton.OnClick();
            }
            if ((InputManager.Keyboard.KeyPushed(Keys.LeftShift) || InputManager.Keyboard.KeyPushed(Keys.RightShift)) && InputManager.Keyboard.KeyPushed(Keys.T))
            {
//                GuiData.ToolsWindow.shiftKeyframeTimeButton.OnClick();
            }
            #endregion

            #region CTRL + A:  Selecting all visible Sprites
            if (InputManager.Keyboard.KeyPushed(Keys.A) &&
                (InputManager.Keyboard.KeyDown(Keys.LeftControl) || InputManager.Keyboard.KeyDown(Keys.RightControl)))
            {
                foreach (Sprite s in EditorData.ActiveSprites)
                {
                    if (CurrentSprites.Contains(s) == false)
                    {
                        SelectSpriteAdd(s, CurrentSprites);
                    }
                }
            }
            #endregion

            #region Key.I to move the Sprite's Instruction Set.
            if (InputManager.Keyboard.KeyPushed(Keys.I) && CurrentSprites.Count != 0)
            {
                oldSpritePosition   = new PositionedObject();
                oldSpritePosition.X = CurrentSprites[0].X;
                oldSpritePosition.Y = CurrentSprites[0].Y;
                oldSpritePosition.Z = CurrentSprites[0].Z;
            }
            //			if(InputManager.KeyDown(Key.I) && currentSprites.Count != 0 && oldSpritePosition == null)
            //			{
            //				oldSpritePosition = new PositionedObject();
            //				oldSpritePosition.X = currentSprites[0].X;
            //				oldSpritePosition.Y = currentSprites[0].Y;
            //				oldSpritePosition.Z = currentSprites[0].Z;
            //			}
            if (InputManager.Keyboard.KeyReleased(Keys.I) && CurrentSprites.Count != 0)
            {
                // AdjustMovementPath();
            }
            #endregion

            #region CTRL+C copying current objects

            if (InputManager.Keyboard.ControlCPushed())
            {
                CopyCurrentObjects();
            }

            #endregion

            #region recording currentSprite
            if (CurrentSprites.Count != 0)
            {
                if (InputManager.Keyboard.KeyPushed(Keys.R))
                {
                    tempPositionVerifier = new Sprite();
                }
            }

            #endregion
        }