Beispiel #1
0
        public DungeonScreen(SadConsole.Tiles.TileMap map)
        {
            // Setup map
            Map        = map;
            MapConsole = new ScrollingConsole(map.Width, map.Height, SadConsole.Global.FontDefault,
                                              new Rectangle(0, 0, ScreenRegionMap.Width, ScreenRegionMap.Height), null);
            Map.ConfigureAsRenderer(MapConsole);

            MapConsole.Position = ScreenRegionMap.Location;
            //MapConsole.ViewPort = new Rectangle(0, 0, ScreenRegionMap.Width, ScreenRegionMap.Height);

            // Setup actions
            ActionProcessor = new SadConsole.Actions.ActionStack();
            ActionProcessor.Push(new SadConsole.Actions.ActionDelegate(ActionKeyboardProcessor));

            _frameManager = new GameFrameManager(map);
            _frameManager.LogicFrameCompleted += (s, e) => RedrawMap = true;

            // Setup messages
            Messages = new MessageConsole(ScreenRegionMessages.Width, ScreenRegionMessages.Height)
            {
                Position = ScreenRegionMessages.Location
            };
            Children.Add(Messages);
            Children.Add(MapConsole);
        }
        public DungeonScreen(SadConsole.Maps.SimpleMap map)
        {
            // Setup map
            Map = map;
            Children.Add(Map);

            // Setup actions
            ActionProcessor = new SadConsole.Actions.ActionStack();
            ActionProcessor.Push(new SadConsole.Actions.ActionDelegate(ActionKeyboardProcessor));

            // Setup messages
            Messages          = new MessageConsole(ScreenRegionMessages.Width, ScreenRegionMessages.Height);
            Messages.Position = ScreenRegionMessages.Location;
            Children.Add(Messages);
        }