Esempio n. 1
0
        private void CutTiles(EditorRoomScene scene)
        {
            short left   = this.xStart <= this.xEnd ? this.xStart : this.xEnd;
            short top    = this.yStart <= this.yEnd ? this.yStart : this.yEnd;
            short right  = this.xStart <= this.xEnd ? this.xEnd : this.xStart;
            short bottom = this.yStart <= this.yEnd ? this.yEnd : this.yStart;

            for (short y = top; y <= bottom; y++)
            {
                for (short x = left; x <= right; x++)
                {
                    scene.DeleteTile(x, y);
                }
            }
        }
Esempio n. 2
0
        public override void RunTick(EditorRoomScene scene)
        {
            if (UIComponent.ComponentWithFocus != null)
            {
                return;
            }

            // Left Mouse Button Down (Delete Current Tile)
            if (Cursor.mouseState.LeftButton == ButtonState.Pressed)
            {
                scene.DeleteTile(Cursor.TileGridX, Cursor.TileGridY);
            }

            // Right Mouse Button Clicked (Clone Current Tile)
            else if (Cursor.RightMouseState == Cursor.MouseDownState.Clicked)
            {
                scene.CloneTile(Cursor.TileGridX, Cursor.TileGridY);
            }
        }