public void setButtonPositions() { Button tempButton = buttons[0]; int counter = 0; int buttonPositionX = GraphicsSettings.realScreenWidth() / 2 - tempButton.getWidth() / 2; int buttonPositionY = counter * tempButton.getHeight() + tempButton.getHeight() / 3; switcherButtons[0].setPos(new Vector2(buttonPositionX, buttonPositionY)); switcherButtons[0].setButtonText("Main Menu"); counter++; buttonPositionY = counter * tempButton.getHeight() + tempButton.getHeight() / 3; buttons[0].setButtonText("Toggle Fullscreen"); buttons[0].setPos(new Vector2(buttonPositionX, buttonPositionY)); counter++; buttonPositionY = counter * tempButton.getHeight() + tempButton.getHeight() / 3; setResolutionText(); buttons[1].setPos(new Vector2(buttonPositionX, buttonPositionY)); buttonPositionY = counter * tempButton.getHeight() + tempButton.getHeight() / 3; buttons[2].setButtonText("Apply changes on startup"); buttons[2].setPos(new Vector2(buttonPositionX + tempButton.getWidth(), buttonPositionY)); }
public virtual void setButtons(ContentManager content) { string imgSrc = "menuButton"; Button tempButton = new Button(content, new Vector2(0, 0), imgSrc); int counter = 0; int buttonPositionX = GraphicsSettings.realScreenWidth() / 2 - tempButton.getWidth() / 2; int buttonPositionY = counter * tempButton.getHeight() + tempButton.getHeight() / 3; buttons = new List <Button>(); switcherButtons.Add(new SwitcherButton(content, new Vector2(buttonPositionX, buttonPositionY), imgSrc, 2)); switcherButtons[0].setButtonText("GAME"); counter++; buttonPositionY = counter * tempButton.getHeight() + tempButton.getHeight() / 3; switcherButtons.Add(new SwitcherButton(content, new Vector2(buttonPositionX, buttonPositionY), imgSrc, 0)); switcherButtons[1].setButtonText("TO SETTINGS"); counter++; buttonPositionY = counter * tempButton.getHeight() + tempButton.getHeight() / 3; buttons.Add(new Button(content, new Vector2(buttonPositionX, buttonPositionY), imgSrc)); buttons[0].setAction(); buttons[0].setButtonText("Exit"); }