public override void loadContent() { if (Game1.getGraphics() != null) { GraphicsDevice graphicsDevice = Game1.getGraphics().GraphicsDevice; float distY = 105 * Settings.getInterfaceScale(); float distX = 400 * Settings.getInterfaceScale();//float distX = 822.5f* Settings.getInterfaceScale(); start = new Button(new Vector2(distX, distY), "Textures/mainmenu/startGame", "Textures/mainmenu/startGameIsPressed"); help = new Button(new Vector2(distX, start.getPosition().Y + start.getHeight() + distY), "Textures/mainmenu/help", "Textures/mainmenu/helpIsPressed"); option = new Button(new Vector2(distX, help.getPosition().Y + help.getHeight() + distY), "Textures/mainmenu/options", "Textures/mainmenu/optionsIsPressed"); credits = new Button(new Vector2(distX, option.getPosition().Y + option.getHeight() + distY), "Textures/mainmenu/credits", "Textures/mainmenu/creditsIsPressed"); exit = new Button(new Vector2(distX, credits.getPosition().Y + credits.getHeight() + distY), "Textures/mainmenu/exit", "Textures/mainmenu/exitIsPressed"); titel = new Icon(new Vector2(0.5f* start.getPosition().X + start.getWidth() + distX, start.getPosition().Y + start.getHeight() + distY), "Textures/mainmenu/titel"); count = 0; start.setSelected(); help.setNotSelected(); option.setNotSelected(); credits.setNotSelected(); exit.setNotSelected(); } }
public override void loadContent() { if (Game1.getGraphics() != null) { distY *= Settings.getInterfaceScale(); offset *= Settings.getInterfaceScale(); optionsTitel = new Icon(optionsTitelPosition * Settings.getInterfaceScale(), "Textures/option/optionsTitel"); fullscreenButton = new Button(new Vector2(560 * Settings.getInterfaceScale(), (optionsTitel.getPosition().Y + optionsTitel.getHeight()) + distY), "Textures/option/Fullscreen", "Textures/option/FullscreenSelected"); resolutionButton = new Button(new Vector2(560 * Settings.getInterfaceScale(), (fullscreenButton.getPosition().Y + fullscreenButton.getHeight()) + distY),"Textures/option/Resolution", "Textures/option/ResolutionSelected"); volumeButton = new Button(new Vector2(560 * Settings.getInterfaceScale(), (resolutionButton.getPosition().Y + resolutionButton.getHeight()) + distY), "Textures/option/Volume", "Textures/option/VolumeSelected"); enterEscNote = new Icon(new Vector2(660 * Settings.getInterfaceScale(), (volumeButton.getPosition().Y + volumeButton.getHeight()) + distY), "Textures/EnterEscNote"); String[] resolutions = { "Textures/option/720p", "Textures/option/1366p", "Textures/option/1080p" };//, "Textures/option/1024p" String[] fullscreenmode = { "Textures/option/offButton", "Textures/option/onButton" }; String[] volumtmodes = { "Textures/option/100Prozent", "Textures/option/90Prozent", "Textures/option/80Prozent", "Textures/option/70Prozent", "Textures/option/60Prozent", "Textures/option/50Prozent", "Textures/option/40Prozent", "Textures/option/30Prozent", "Textures/option/20Prozent", "Textures/option/10Prozent", "Textures/option/offButton" }; resolutionLR = new LeftRightSwitch(new Vector2(resolutionButton.getPosition().X + resolutionButton.getWidth() + offset, resolutionButton.getPosition().Y), resolutions); fullscreenLR = new LeftRightSwitch(new Vector2(fullscreenButton.getPosition().X + fullscreenButton.getWidth() + offset, fullscreenButton.getPosition().Y), fullscreenmode); volumeLR = new LeftRightSwitch(new Vector2(volumeButton.getPosition().X + volumeButton.getWidth() + offset, volumeButton.getPosition().Y), volumtmodes); //always show the actual settings selected first if (Settings.isFullscreen()) fullscreenLR.switchLeft(); if (Settings.getResolutionX() == 1366) resolutionLR.switchRight(); if (Settings.getResolutionX() == 1920) resolutionLR.switchLeft(); int h = 10 - (int)(Settings.getSoundVolume() * 10); while (volumeLR.getDisplayedIndex() != h) volumeLR.switchLeft(); //initially set the buttons volumeButton.setNotSelected(); volumeLR.setNotSelected(); resolutionButton.setNotSelected(); resolutionLR.setNotSelected(); fullscreenButton.setSelected(); fullscreenLR.setSelected(); } }