public ChooseScenarioScreen() { GameButton FirstBloodButton = new TextGameButton(new Vector2(300, 25), new Vector2(GameCamera.GetScreenWidth() / 2 - 150, 400), FirstBloodScenario.NAME); FirstBloodButton.RegisterOnClick(ChooseScenario); FirstBloodButton.RegisterCallbackObject<Scenario>(new FirstBloodScenario()); AddButton(FirstBloodButton); }
private void ShowPossibleActions(Character character) { ClearButtons(); if (character != null) { List<IAction> actions = character.GetPossibleActions(); var i = 0; foreach (var action in actions) { var labelSize = FontFactory.Font.MeasureString(action.GetLabel()); TextGameButton button = new TextGameButton(new Vector2(labelSize.X / 2 + 40, 40), new Vector2(Rect.X + Rect.Width / 2 - (labelSize.X / 2 + 40) / 2, 500 + 50 * i), action.GetLabel()); button.Show(); button.RegisterCallbackObject(action); button.RegisterOnClick(OnActionClick); buttons.Add(button); i++; } } }