Esempio n. 1
0
 public GUI(Window win, TCODConsole main, Camera camera)
 {
     statusWindow = new TCODConsole(Window.StatusPanelWidth, win.Height);
     eventLog = new TCODConsole(win.Width - Window.StatusPanelWidth, Window.MessagePanelHeight);
     statusWindow.setAlignment(TCODAlignment.CenterAlignment);
     statusWindow.setBackgroundColor(TCODColor.darkestRed.Multiply(0.1f));
     this.main = main;
     this.window = win;
     this.camera = camera;
 }
Esempio n. 2
0
        public void Draw(Window window, Camera camera)
        {
            for (int x = camera.Left; x < camera.Right; ++x)
            {
                for (int y = camera.Top; y < camera.Bottom; ++y)
                {
                    int windowX = x - camera.Left;
                    int windowY = y - camera.Top;
                    int light = lightingMap.GetLightLevel(x, y);
                    if (light != 0 || lightingMap.GetExplored(x, y))
                    {
                        float lightMod;
                        if (lightingMap[x, y].IsExplored && light == 0)
                            lightMod = LightingMap.ExploredLightScale;
                        else
                            lightMod = Math.Min(1f, ((light * (1- LightingMap.ExploredLightScale) / LightingMap.IntensityScaleFactor)
                                +  LightingMap.ExploredLightScale));

                        window.Draw(lightMod,
                            this[x, y].VisibleEntity == null ? this[x, y].Color : this[x, y].VisibleEntity.Color,
                            this[x, y].VisibleEntity == null ? this[x, y].Character : this[x, y].VisibleEntity.Character, windowX, windowY);
                    }
                    else
                        window.Draw(TCODColor.black, windowX, windowY);
                }
            }
        }