/// <summary> /// /// </summary> public override void LoadContent() { content = new ContentManager(ScreenManager.Game.Services, "Content"); menuBackground = content.Load<Texture2D>("GUI/MenuBackground"); //Buttons are 300 x 75 Texture2D exitText = content.Load<Texture2D>("GUI/ExitButton"); Texture2D patientText = content.Load<Texture2D>("GUI/PatientButton"); Texture2D optionsText = content.Load<Texture2D>("GUI/OptionsButton"); int menuX = (ScreenManager.GraphicsDevice.Viewport.Width / 2) - (menuBackground.Width / 2); int menuY = (ScreenManager.GraphicsDevice.Viewport.Height / 2) - (menuBackground.Height / 2); menuRect = new Rectangle(menuX, menuY, menuBackground.Width, menuBackground.Height); int buttonSpace = 75; int buttonX = menuX + (menuBackground.Width / 2) - 150; int buttonY = menuY + buttonSpace; Rectangle patientRect = new Rectangle(buttonX, buttonY, patientText.Width, patientText.Height); Rectangle optionsRect = new Rectangle(buttonX, patientRect.Y + buttonSpace + patientText.Height, optionsText.Width, optionsText.Height); Rectangle exitRect = new Rectangle(buttonX, optionsRect.Y + buttonSpace + exitText.Height, exitText.Width, exitText.Height); exitButton = new GameLibrary.UI.Button(exitText, exitRect); patientButton = new GameLibrary.UI.Button(patientText, patientRect); optionsButton = new GameLibrary.UI.Button(optionsText, optionsRect); }
public override void LoadContent() { content = new ContentManager(ScreenManager.Game.Services, "Content"); optionsBackground = content.Load<Texture2D>("GUI/MenuBackground"); //Buttons are 300 x 75 Texture2D selectText = content.Load<Texture2D>("GUI/SelectButton"); Texture2D cancelText = content.Load<Texture2D>("GUI/CancelButton"); int menuX = (ScreenManager.GraphicsDevice.Viewport.Width / 2) - (optionsBackground.Width / 2); int menuY = (ScreenManager.GraphicsDevice.Viewport.Height / 2) - (optionsBackground.Height / 2); optionsRect = new Rectangle(menuX, menuY, optionsBackground.Width, optionsBackground.Height); Rectangle selectRect = new Rectangle(menuX, menuY + optionsBackground.Height, selectText.Width, selectText.Height); Rectangle cancelRect = new Rectangle(menuX + (optionsBackground.Width - cancelText.Width), menuY + optionsBackground.Height, selectText.Width, selectText.Height); selectButton = new GameLibrary.UI.Button(selectText, selectRect); cancelButton = new GameLibrary.UI.Button(cancelText, cancelRect); Vector2 position = new Vector2(menuX + ((optionsBackground.Width / 2)), menuY + ScreenManager.ScaleYPosition(50)); Texture2D dummyTexture = new Texture2D(ScreenManager.GraphicsDevice, 1, 1); dummyTexture.SetData(new Color[] { Color.White }); SpriteFont font = content.Load<SpriteFont>("Font"); molesUpDown = new GameLibrary.UI.NumericUpDown(dummyTexture, position, GameLibrary.UI.Label.CENTER, 100.0f,font, 1m, 1m, 6m, 1m); position.Y += ScreenManager.ScaleYPosition(50); timerUpDown = new GameLibrary.UI.NumericUpDown(dummyTexture, position, GameLibrary.UI.Label.CENTER, 100.0f, font, 0.25m, 0.25m, 10.00m, 0.25m); position.Y += ScreenManager.ScaleYPosition(50); repetitionUpDown = new GameLibrary.UI.NumericUpDown(dummyTexture, position, GameLibrary.UI.Label.CENTER, 100.0f, font, 1m, 1m, 1000m, 1m); position.Y += ScreenManager.ScaleYPosition(75); List<String> hands = new List<String> { "Right", "Left" }; handList = new GameLibrary.UI.List(hands, 175, 2, 25, position, dummyTexture, font, Color.Black, Color.White); position = new Vector2(menuX + ((optionsBackground.Width / 2)) - ScreenManager.ScaleXPosition(300), menuY + ScreenManager.ScaleYPosition(50)); moleLabel = new GameLibrary.UI.Label("Number of Moles:", position, GameLibrary.UI.Label.LEFT, 200.0f, font); position.Y += ScreenManager.ScaleYPosition(50); timerLabel = new GameLibrary.UI.Label("Mole Up Time:", position, GameLibrary.UI.Label.LEFT, 200.0f, font); position.Y += ScreenManager.ScaleYPosition(50); repetitionLabel = new GameLibrary.UI.Label("Number of Reps:", position, GameLibrary.UI.Label.LEFT, 200.0f, font); position.Y += ScreenManager.ScaleYPosition(85); handLabel = new GameLibrary.UI.Label("Hand Used:", position, GameLibrary.UI.Label.LEFT, 200.0f, font); }
public override void LoadContent() { content = new ContentManager(ScreenManager.Game.Services, "Content"); font = content.Load<SpriteFont>("Font"); winFont = content.Load<SpriteFont>("WinFont"); line1 = "You Win!!!"; line2 = "Play Time: "; line3 = "Moles Wacked: "; line4 = "Moles Unharmed: "; float xCenter = ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2.0f; float yCenter = ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2.5f; line1Position = new Vector2((xCenter - font.MeasureString(line1).X), yCenter); line2Position = new Vector2((xCenter - font.MeasureString(line2 + "99:99:99.99").X / 2.0f), (line1Position.Y + font.MeasureString(line1).Y*2)); line3Position = new Vector2((xCenter - font.MeasureString(line3 + "999").X / 2.0f), (line2Position.Y + font.MeasureString(line2).Y)); line4Position = new Vector2((xCenter - font.MeasureString(line4 + "999").X / 2.0f), (line3Position.Y + font.MeasureString(line3).Y)); Texture2D exitText = content.Load<Texture2D>("GUI/ExitButton"); Texture2D replayText = content.Load<Texture2D>("GUI/ReplayButton"); float buttonSpace = this.ScreenManager.ScaleXPosition(50.0f); float buttonX = xCenter - (buttonSpace / 2.0f) - (float)exitText.Width; float buttonY = ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 1.25f; Rectangle exitRect = new Rectangle((int)buttonX, (int)buttonY, exitText.Width, exitText.Height); Rectangle replayRect = new Rectangle((int)(buttonX + exitText.Width + buttonSpace), (int)buttonY, replayText.Width, replayText.Height); exitButton = new GameLibrary.UI.Button(exitText, exitRect); replayButton = new GameLibrary.UI.Button(replayText, replayRect); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your Content. /// </summary> public override void LoadContent() { Content = new ContentManager(ScreenManager.Game.Services, "Content"); patientBackground = Content.Load<Texture2D>("GUI/MenuBackground"); //Buttons are 300 x 75 Texture2D selectText = Content.Load<Texture2D>("GUI/SelectButton"); Texture2D cancelText = Content.Load<Texture2D>("GUI/CancelButton"); int menuX = (ScreenManager.GraphicsDevice.Viewport.Width / 2) - (patientBackground.Width / 2); int menuY = (ScreenManager.GraphicsDevice.Viewport.Height / 2) - (patientBackground.Height / 2); patientRect = new Rectangle(menuX, menuY, patientBackground.Width, patientBackground.Height); Rectangle selectRect = new Rectangle(menuX, menuY + patientBackground.Height, selectText.Width, selectText.Height); Rectangle cancelRect = new Rectangle(menuX + (patientBackground.Width - cancelText.Width), menuY + patientBackground.Height, selectText.Width, selectText.Height); selectButton = new GameLibrary.UI.Button(selectText, selectRect); cancelButton = new GameLibrary.UI.Button(cancelText, cancelRect); Vector2 position = new Vector2(menuX + ((patientBackground.Width / 2) - 100), menuY + 50); Texture2D dummyTexture = new Texture2D(ScreenManager.GraphicsDevice, 1, 1); dummyTexture.SetData(new Color[] { Color.White }); SpriteFont font = Content.Load<SpriteFont>("Font"); patientList = new GameLibrary.UI.List(LoadList(), 200, 15, 28, position, dummyTexture, font); }
//private GraphicsDeviceManager Graphics; ////constructor //public MenuScreen(GraphicsDeviceManager graphics) //{ // this.Graphics = graphics; //} /// <summary> /// /// </summary> public override void LoadContent() { //DrawShape draw = new DrawShape(); //Texture2D circleOverlay = draw.drawShape("Circle", 20, this.Graphics); this.content = new ContentManager(ScreenManager.Game.Services, "Content"); this.menuBackground = this.content.Load<Texture2D>("Sprites/MenuBackground"); //Buttons are 300 x 75 but lets change it to have the drawShape method make the shape for us DrawShape mydraw = new DrawShape(); //Texture2D exitText = mydraw.drawShape("Square", 100, this.Graphics); //Texture2D patientText = mydraw.drawShape("Circle", 100, this.Graphics); //Texture2D optionsText = mydraw.drawShape("Rectanlge", 100, this.Graphics); Texture2D exitText = content.Load<Texture2D>("GUI/ExitButton"); Texture2D patientText = content.Load<Texture2D>("GUI/PatientButton"); Texture2D optionsText = content.Load<Texture2D>("GUI/OptionsButton"); int menuX = (ScreenManager.GraphicsDevice.Viewport.Width / 2) - (menuBackground.Width / 2); int menuY = (ScreenManager.GraphicsDevice.Viewport.Height / 2) - (menuBackground.Height / 2); menuRect = new Rectangle(menuX, menuY, menuBackground.Width, menuBackground.Height); int buttonSpace = 75; int buttonX = menuX + (menuBackground.Width / 2) - 150; int buttonY = menuY + buttonSpace; Rectangle patientRect = new Rectangle(buttonX, buttonY, patientText.Width, patientText.Height); Rectangle optionsRect = new Rectangle(buttonX, patientRect.Y + buttonSpace + patientText.Height, optionsText.Width, optionsText.Height); Rectangle exitRect = new Rectangle(buttonX, optionsRect.Y + buttonSpace + exitText.Height, exitText.Width, exitText.Height); exitButton = new GameLibrary.UI.Button(exitText, exitRect); patientButton = new GameLibrary.UI.Button(patientText, patientRect); optionsButton = new GameLibrary.UI.Button(optionsText, optionsRect); }