Ejemplo n.º 1
0
 // Restricts the dimensions of the AutoTile placement to the vertical axis.
 private void PlaceAutoTilesVertical(EditorRoomScene scene, short top, short bottom, short xLevel)
 {
     for (short y = top; y <= bottom; y++)
     {
         byte subType = this.GetSubTypeAtPosition(xLevel, y);
         scene.PlaceTile(scene.levelContent.data.rooms[scene.roomID].main, LayerEnum.main, xLevel, y, this.tileId, subType, null);
     }
 }
Ejemplo n.º 2
0
 // Restricts the dimensions of the AutoTile placement to the horizontal axis.
 private void PlaceAutoTilesHorizontal(EditorRoomScene scene, short left, short right, short yLevel)
 {
     for (short x = left; x <= right; x++)
     {
         byte subType = this.GetSubTypeAtPosition(x, yLevel);
         scene.PlaceTile(scene.levelContent.data.rooms[scene.roomID].main, LayerEnum.main, x, yLevel, this.tileId, subType, null);
     }
 }
Ejemplo n.º 3
0
 // Places a full X+Y grid.
 private void PlaceAutoTilesFull(EditorRoomScene scene, short left, short right, short top, short bottom)
 {
     for (short x = left; x <= right; x++)
     {
         for (short y = top; y <= bottom; y++)
         {
             byte subType = this.GetSubTypeAtPosition(x, y);
             scene.PlaceTile(scene.levelContent.data.rooms[scene.roomID].main, LayerEnum.main, x, y, this.tileId, subType, null);
         }
     }
 }
Ejemplo n.º 4
0
        public void PlaceAutoTiles(EditorRoomScene scene)
        {
            // Skip this method if the auto-tile isn't in operation.
            if (!this.IsActive)
            {
                return;
            }

            short left   = this.LeftTile;
            short right  = this.RightTile;
            short top    = this.TopTile;
            short bottom = this.BottomTile;

            if (this.autoGroup == AutoGroup.Full || this.autoGroup == AutoGroup.Static)
            {
                this.PlaceAutoTilesFull(scene, left, right, top, bottom);
            }

            else if (this.autoGroup == AutoGroup.Ledge)
            {
                this.PlaceAutoTilesLedge(scene, left, right, top, bottom);
            }

            else if (this.autoGroup == AutoGroup.Horizontal)
            {
                this.PlaceAutoTilesHorizontal(scene, left, right, this.yStart);
            }

            else if (this.autoGroup == AutoGroup.Vertical)
            {
                this.PlaceAutoTilesVertical(scene, top, bottom, this.xStart);
            }

            else if (this.autoGroup == AutoGroup.StaticCross)
            {
                // If Horizontal is greater than or equal to Vertical distance, draw horizontal:
                if (Math.Abs(right - left) > Math.Abs(bottom - top))
                {
                    this.PlaceAutoTilesHorizontal(scene, left, right, this.yStart);
                }

                // Otherwise, draw vertical:
                else
                {
                    this.PlaceAutoTilesVertical(scene, top, bottom, this.xStart);
                }
            }

            this.ClearAutoTiles();
        }
Ejemplo n.º 5
0
        // Special Ledge Placement (full axis movement). Top section will use Ledge, rest will use LedgeDecor.
        private void PlaceAutoTilesLedge(EditorRoomScene scene, short left, short right, short top, short bottom)
        {
            byte ledgeTool = this.tileId;
            byte decorTool = (byte)TileEnum.LedgeDecor;

            // Place Top of Ledge
            for (short x = left; x <= right; x++)
            {
                byte subType = this.GetSubTypeAtPosition(x, top);
                scene.PlaceTile(scene.levelContent.data.rooms[scene.roomID].main, LayerEnum.main, x, top, ledgeTool, subType, null);
            }

            // Place Rest of Ledge (Decor)
            top += 1;
            for (short x = left; x <= right; x++)
            {
                for (short y = top; y <= bottom; y++)
                {
                    byte subType = this.GetSubTypeAtPosition(x, y);
                    scene.PlaceTile(scene.levelContent.data.rooms[scene.roomID].bg, LayerEnum.bg, x, y, decorTool, subType, null);
                }
            }
        }