public void CreateInGameUI() { inventoryPanel = new Panel(new Vector2(300, 300)); UserInterface.Active.AddEntity(inventoryPanel); inventoryPanel.PanelOverflowBehavior = PanelOverflowBehavior.VerticalScroll; inventoryPanel.Visible = false; inventoryButton = new GBBtutton("Inventory", skin: ButtonSkin.Alternative, anchor: Anchor.BottomRight, size: new Vector2(300, 50)); inventoryButton.ToggleMode = true; inventoryButton.OnValueChange = OpenInventory; UserInterface.Active.AddEntity(inventoryButton); inventoryButton.Visible = false; }
public void CreateStartMenu() { startScreenPanel = new Panel(); UserInterface.Active.AddEntity(startScreenPanel); hostButton = new GBBtutton("Host", skin: ButtonSkin.Alternative, anchor: Anchor.Auto, size: new Vector2(300, 50)); startScreenPanel.AddChild(hostButton); hostButton.OnClick += StartHost; input = new TextInput(false, anchor: Anchor.Auto, size: new Vector2(300, 50)); input.PlaceholderText = "Insert Host IP"; startScreenPanel.AddChild(input); clientButton = new GBBtutton("Connect to host", skin: ButtonSkin.Alternative, anchor: Anchor.Auto, size: new Vector2(300, 50)); startScreenPanel.AddChild(clientButton); clientButton.OnClick += ConnectToHost; }