Example #1
0
        public static void ResizeHeight()
        {
            EditorRoomScene scene         = ((EditorScene)Systems.scene).CurrentRoom;
            int             currentHeight = scene.yCount;

            ConsoleTrack.possibleTabs = "Example: `resize height 180`";
            ConsoleTrack.helpText     = "Resize the level's height between " + (byte)TilemapEnum.MinHeight + " and " + (short)TilemapEnum.MaxTilesHigh + ". Currently at " + currentHeight + ".";

            // Prepare Height
            int getHeight = ConsoleTrack.GetArgAsInt();

            // Activate the Instruction
            if (ConsoleTrack.activate)
            {
                if (getHeight < (byte)TilemapEnum.MinHeight)
                {
                    getHeight = (byte)TilemapEnum.MinHeight;
                }
                if (getHeight > (short)TilemapEnum.MaxTilesHigh)
                {
                    getHeight = (short)TilemapEnum.MaxTilesHigh;
                }
                scene.ResizeHeight((short)getHeight);
            }
        }
Example #2
0
        public static void ResizeOneScreen()
        {
            ConsoleTrack.possibleTabs = "Example: `resize one-screen`";
            ConsoleTrack.helpText     = "Resize a room to be one screen. WARNING: This will delete all tiles down to one room size.";

            // Activate the Instruction
            if (ConsoleTrack.activate)
            {
                EditorRoomScene scene = ((EditorScene)Systems.scene).CurrentRoom;
                scene.ResizeHeight((byte)TilemapEnum.MinHeight);
                scene.ResizeWidth((byte)TilemapEnum.MinWidth);
            }
        }
Example #3
0
        public static void ResizeCustom()
        {
            int currentWidth  = ((EditorRoomScene)Systems.scene).xCount;
            int currentHeight = ((EditorRoomScene)Systems.scene).yCount;

            ConsoleTrack.possibleTabs = "Example: `resize custom 100 35`";
            ConsoleTrack.helpText     = "Resize a room to be a custom width and height (in that order). Currently at " + currentWidth + ", " + currentHeight + ".";

            // Prepare Height
            int getWidth  = ConsoleTrack.GetArgAsInt();
            int getHeight = ConsoleTrack.GetArgAsInt();

            // Activate the Instruction
            if (ConsoleTrack.activate)
            {
                if (getWidth < (byte)TilemapEnum.MinWidth)
                {
                    getWidth = (byte)TilemapEnum.MinWidth;
                }
                if (getWidth > (short)TilemapEnum.MaxTilesWide)
                {
                    getWidth = (short)TilemapEnum.MaxTilesWide;
                }
                if (getHeight < (byte)TilemapEnum.MinHeight)
                {
                    getHeight = (byte)TilemapEnum.MinHeight;
                }
                if (getHeight > (short)TilemapEnum.MaxTilesHigh)
                {
                    getHeight = (short)TilemapEnum.MaxTilesHigh;
                }
                EditorRoomScene scene = ((EditorScene)Systems.scene).CurrentRoom;
                scene.ResizeHeight((short)getWidth);
                scene.ResizeWidth((short)getHeight);
            }
        }