protected void Load() { Layers = LoadLayers().ToArray(); BackgroundColor = new Color(20, 30, 20); Position = new Rectangle(); Position.Set(Engine.GetScreenSize()); LoadSceneContent(); foreach (var displayable in Layers.SelectMany(p => p.FixedDisplayable)) { Position.ExpandToContain(displayable.Position); } Boundary = new Boundary(this); if (CollisionManager != null) { CollisionManager.Layer.CollidableObjects.Add(Boundary); } if (CameraCenter == null) { CameraCenter = this; } transitions = LoadTransitions().ToArray(); }
public Menu(Layer interfaceLayer, SpriteFont font, BorderTileSet tileSet, IGameInputWithDPad input, MenuKeys menuKeys) { MenuPanel = new LayoutPanel(tileSet, interfaceLayer); MenuPanel.Position.Center = Engine.GetScreenSize().Center; MenuPanel.Visible = false; Layer = interfaceLayer; Font = font; Input = input; MenuKeys = menuKeys; foreach (var group in interfaceLayer.Scene.UpdateGroups) { if (group.Priority != UpdatePriority.ModalMenu && group.Priority != UpdatePriority.Input) { group.AddPauseCondition(MenuPanel.IsVisible()); } } interfaceLayer.Scene.AddObject(this); }