Exemple #1
0
        private BasicSurface GenerateWorld()
        {
            generator = new SadConsole.GameHelpers.WorldGeneration.WrappingWorldGenerator <SadConsole.GameHelpers.WorldGeneration.SurfaceMap, BasicSurface>();
            generator.Start(512, 256);
            var textSurface = generator.BiomeMapRenderer;

            textSurface.Font = Global.Fonts[Global.FontDefault.Name].GetFont(SadConsole.Font.FontSizes.Half);
            return(textSurface);
        }
Exemple #2
0
        public override void Render()
        {
            // These 3 render calls are a hack to get the console data generated and display a message to the user
            // Should add in async calls that let us generate these in the background... That would be cool.

            if (!initialized)
            {
                base.Render();
            }

            else if (!initializedStep2)
            {
                initializedStep2 = true;
                base.Render();
                messageData.Render();
            }
            else if (!initializedStep3)
            {
                base.Render();

                // Generate the content
                //mainData = new CellSurface(2000, 2000);

                // Clear message data and make it transparent so that it acts as a layer
                messageData.CellData.Fill(Color.White, Color.Transparent, 0, null);

                generator = new SadConsole.GameHelpers.WorldGeneration.WrappingWorldGenerator <SadConsole.GameHelpers.WorldGeneration.CellSurfaceMap, CellSurface>();
                generator.Start(256, 256);
                CellData = generator.BiomeMapRenderer;
                messageData.CellData.Print(0, 0, $"[SPACE] Change Map Info [ENTER] New Map -- Biome   ", Color.White, Color.Black);
                this.CellSize = new Point(this.Font.CellWidth / ZoomLevel.X, this.Font.CellHeight / ZoomLevel.Y);

                initializedStep3 = true;
            }

            else
            {
                // Set message data information about where the viewport is located
                //messageData.CellData.Print(0, 0, $"{ViewArea.X} , {ViewArea.Y}            ", Color.White, Color.Black);

                // Create a faux layering system.
                base.Render();

                if (IsVisible)
                {
                    messageData.Render();
                }
            }
        }