Example #1
0
        public override void Update(GameTime gameTime)
        {
            var mouseState = GameMouse.GetState();

            if (mouseState.LeftButton == ButtonState.Released && _previousMouseState.LeftButton == ButtonState.Pressed) {

                if (!(CurrentlySelectedNode != null && CurrentlySelectedNode.IsMouseDown)) {
                    // Create a new node, and also set it to be the newest created node
                    if (CurrentlySelectedNode != null) CurrentlySelectedNode.SetColorState(ColorState.None);
                    CurrentlySelectedNode = CreateNode((int)World.MouseInWorld.X, (int)World.MouseInWorld.Y);
                    CurrentlySelectedNode.SetColorState(ColorState.DarkDark);
                }
            }
            _previousMouseState = mouseState;
        }
Example #2
0
        public override void Update(GameTime gameTime)
        {
            PreviousMouseState = CurrentMouseState;
            CurrentMouseState = GameMouse.GetState();

            if (!Enabled) return;
            UpdateCamera();
            FireMouseEvents();
        }