Drawing Buttons To Scene
//---Button Instantiations---
playButton = new Button(
Content.Load<Texture2D>("PlayButton"),
new Rectangle(30, 200, 350, 50));
shopButton = new Button(
Content.Load<Texture2D>("ShopButton"),
new Rectangle(30, 275, 350, 50));
howToPlayButton = new Button(
howToPlayButtonTexture,
new Rectangle(30, 350, 350, 50));
creditButton = new Button(
Content.Load<Texture2D>("CreditsButton"),
new Rectangle(30, 425, 350, 50));
creditBackButton = new Button(
Content.Load<Texture2D>("BackButton"),
new Rectangle(235, 730, 350, 50));
exitButton = new Button(
Content.Load<Texture2D>("ExitButton"),
new Rectangle(30, 500, 350, 50));
resumeButton = new Button(
Content.Load<Texture2D>("ResumeButton"),
new Rectangle(250, 275, 300, 50));
howToPlayButtonInGame = new Button(
howToPlayButtonTexture,
new Rectangle(250, 330, 300, 50));
restartButton = new Button(
Content.Load<Texture2D>("RestartButton"),
new Rectangle(250, 385, 300, 50));
mainMenuButton = new Button(
Content.Load<Texture2D>("MainMenuButton"),
new Rectangle(250, 440, 300, 50));
backButton = new Button(
Content.Load<Texture2D>("BackButton"),
new Rectangle(250, 700, 300, 50));
godButtonUnchecked = new Button(
Content.Load<Texture2D>("UnCheckedButton"),
new Rectangle(170, 600, 50, 50));
godButtonChecked = new Button(
Content.Load<Texture2D>("CheckButton"),
new Rectangle(170, 600, 50, 50));
//shop buttons
defaultTextureButton = new Button(
Content.Load<Texture2D>("EquipButton"),
new Rectangle(100, 280, 300, 60));
whiteSuitPurchaseButton = new Button(
Content.Load<Texture2D>("PurchaseButton"),
new Rectangle(420, 100, 300, 50));
whiteSuitEquipButton = new Button(
Content.Load<Texture2D>("EquipButton"),
new Rectangle(400, 280, 340, 60));
underwearPurchaseButton = new Button(
Content.Load<Texture2D>("PurchaseButton"),
new Rectangle(415, 500, 300, 50));
underwearEquipButton = new Button(
Content.Load<Texture2D>("EquipButton"),
new Rectangle(400, 680, 340, 70));
dripPurchaseButton = new Button(
Content.Load<Texture2D>("PurchaseButton"),
new Rectangle(100, 500, 300, 50));
dripEquipButton = new Button(
Content.Load<Texture2D>("EquipButton"),
new Rectangle(80, 680, 320, 70));if (playButton.Update() == true)
{
titleInstance.Stop();
gameState = GameState.Game;
}
if (shopButton.Update() == true)
{
titleInstance.Stop();
gameState = GameState.Shop;
}
if (howToPlayButton.Update() == true)
{
gameState = GameState.HowToPlay;
}
if (creditButton.Update() == true)
{
gameState = GameState.Credits;
}
if (exitButton.Update() == true)
{
Exit();
}Clicking Button In Scnene
Comments