Example #1
0
        private static void OnRootConsoleRender(object sender, UpdateEventArgs e)
        {
            //Don't redraw everything unless something changes
            if (_renderRequired)
            {
                DungeonMap.Draw(_mapConsole);
                Player.Draw(_mapConsole, DungeonMap);

                /*Blitting - adding two consoles (bitmaps) on top of each other.
                 * Takes the source console, the starting position for X and Y, the dimensions of the source console, then takes the root console and maps
                 * the source console based on dimensions passed in
                 */
                RLConsole.Blit(_mapConsole, 0, 0, _mapWidth, _mapHeight, _rootConsole, 0, _inventoryHeight);
                RLConsole.Blit(_statConsole, 0, 0, _statWidth, _statHeight, _rootConsole, _mapWidth, 0);
                RLConsole.Blit(_messageConsole, 0, 0, _messageWidth, _messageHeight, _rootConsole, 0, _screenHeight - _messageHeight);
                RLConsole.Blit(_inventoryConsole, 0, 0, _inventoryWidth, _inventoryHeight, _rootConsole, 0, 0);



                _rootConsole.Draw();
            }

            _renderRequired = false;
        }