public override void OnActivate() { BackgroundImage = Root.Singleton.Material("img/box_text_sectors.png"); base.OnActivate(); var lblTitle = new Label(); lblTitle.X = 25; lblTitle.Y = 40; lblTitle.Text = "Choose the next sector:"; lblTitle.Font = Root.Singleton.Font("fonts/JustinFont12Bold.ttf"); lblTitle.AutoScale = false; lblTitle.Scale = 0.475f; lblTitle.Parent = Window; lblTitle.Init(); var nodes = Map.CurrentNode.NextNodes; for (int i = 0; i < nodes.Count; i++) { var node = nodes[i]; AddButton(80 + i * 25, "" + (i + 1) + ". " + node.Sector.Name); } var map = new SectorMapPanel(Map); Util.LayoutControl(map, 28, 210, 558, 148, ScreenRectangle); map.Parent = Window; map.Init(); }
public override void OnActivate(params object[] args) { if (args.Length >= 1 && args[0] is SectorMap) { Map = (SectorMap)args[0]; } else { Map = new SectorMap(); } BackgroundImage = Root.Singleton.Material("img/box_text_sectors.png"); base.OnActivate(); var lblTitle = new Label(); lblTitle.X = 25; lblTitle.Y = 40; lblTitle.Text = "Choose the next sector:"; lblTitle.Font = Root.Singleton.Font("fonts/JustinFont12Bold.ttf"); lblTitle.AutoScale = false; lblTitle.Scale = 0.475f; lblTitle.Parent = Window; lblTitle.Init(); var nodes = Map.CurrentNode.NextNodes; for (int i = 0; i < nodes.Count; i++) { var node = nodes[i]; AddButton(80 + i * 25, "" + (i + 1) + ". " + node.Sector.Name); } var map = new SectorMapPanel(Map); Util.LayoutControl(map, 28, 210, 558, 148, ScreenRectangle); map.Parent = Window; map.Init(); }
public void OnActivate() { // Store window window = Root.Singleton.Window; rctScreen = Util.ScreenRect(window.Size.X, window.Size.Y, 1.7778f); finishnow = false; window.KeyPressed += window_KeyPressed; // Create UI pnObscure = new Panel(); pnObscure.Colour = new Color(0, 0, 0, 192); Util.LayoutControl(pnObscure, 0, 0, 1280, 720, rctScreen); pnObscure.Parent = Root.Singleton.Canvas; pnObscure.Init(); pnWindow = new ImagePanel(); pnWindow.Image = Root.Singleton.Material("img/box_text_sectors.png"); Util.LayoutControl(pnWindow, (int)(1280 - pnWindow.Image.Size.X) / 2, (int)(720 - pnWindow.Image.Size.Y) / 2, (int)pnWindow.Image.Size.X, (int)pnWindow.Image.Size.Y, rctScreen); pnWindow.Parent = Root.Singleton.Canvas; pnWindow.Init(); var lblTitle = new Label(); lblTitle.X = 25; lblTitle.Y = 40; lblTitle.Text = "Choose the next sector:"; lblTitle.Font = Root.Singleton.Font("fonts/JustinFont12Bold.ttf"); lblTitle.AutoScale = false; lblTitle.Scale = 0.475f; lblTitle.Parent = pnWindow; lblTitle.Init(); var nodes = Map.CurrentNode.NextNodes; for (int i = 0; i < nodes.Count; i++) { var node = nodes[i]; AddButton(80 + i * 30, "" + (i + 1) + ". " + node.Name); } var map = new SectorMapPanel(Map); Util.LayoutControl(map, 28, 210, 558, 148, rctScreen); map.Parent = pnWindow; map.Init(); // Modal screen Root.Singleton.Canvas.ModalFocus = pnWindow; }
public void OnActivate() { // Store window window = Root.Singleton.Window; rctScreen = Util.ScreenRect(window.Size.X, window.Size.Y, 1.7778f); finishnow = false; window.KeyPressed += window_KeyPressed; // Create UI pnObscure = new Panel(); pnObscure.Colour = new Color(0, 0, 0, 192); Util.LayoutControl(pnObscure, 0, 0, 1280, 720, rctScreen); pnObscure.Parent = Root.Singleton.Canvas; pnObscure.Init(); pnWindow = new ImagePanel(); pnWindow.Image = Root.Singleton.Material("img/box_text_sectors.png"); Util.LayoutControl(pnWindow, (int)(1280 - pnWindow.Image.Size.X) / 2, (int)(720 - pnWindow.Image.Size.Y) / 2, (int)pnWindow.Image.Size.X, (int)pnWindow.Image.Size.Y, rctScreen); pnWindow.Parent = Root.Singleton.Canvas; pnWindow.Init(); var lblTitle = new Label(); lblTitle.X = 25; lblTitle.Y = 40; lblTitle.Text = "Choose the next sector:"; lblTitle.Font = Root.Singleton.Font("fonts/JustinFont12Bold.ttf"); lblTitle.AutoScale = false; lblTitle.Scale = 0.475f; lblTitle.Parent = pnWindow; lblTitle.Init(); var nodes = Map.CurrentNode.NextNodes; for (int i = 0; i < nodes.Count; i++) { var node = nodes[i]; AddButton(80 + i * 25, "" + (i + 1) + ". " + node.Sector.Name); } var map = new SectorMapPanel(Map); Util.LayoutControl(map, 28, 210, 558, 148, rctScreen); map.Parent = pnWindow; map.Init(); // Modal screen Root.Singleton.Canvas.ModalFocus = pnWindow; }