public override void Draw(SpriteBatch spritebatch) { if (Star.Star_speed == 1) { if (active == true) { spritebatch.Draw(skin, new Rectangle((int)pos.X, (int)pos.Y, 760, 440), Color.Gray); // Bakgrund if (x > 739 && x < 761 && y > 29 && y < 51) // Avstägning { spritebatch.Draw(skin, new Rectangle(738, 28, 24, 24), Color.Red); spritebatch.DrawString(text, "X", new Vector2(740, 10), Color.Black, 0f, new Vector2(0, 0), 2.5f, SpriteEffects.FlipVertically, 0f); } else { spritebatch.Draw(skin, new Rectangle(740, 30, 20, 20), Color.Red); // Avstägnings knapp spritebatch.DrawString(text, "X", new Vector2(742, 15), Color.Black, 0f, new Vector2(0, 0), 2f, SpriteEffects.FlipVertically, 0f); } // ######## Start Meny ############ if (scene == 0) { CardShower.Show(spritebatch, new Vector2(60, 60), cards[0], cards[1], cards[2], cards[3], cards[4], cards[5]); } } } }
protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); stars = new Star(Content.Load <Texture2D>("WhiteP"), new Vector2(150, 150)); laser = new Laser(Content.Load <Texture2D>("WhiteP"), new Vector2(-100, 900)); internet = new Internet(Content.Load <Texture2D>("WhiteP"), Content.Load <SpriteFont>("Controll"), new Vector2(20, 20)); health = new HealthBar(Content.Load <Texture2D>("LongWhite"), Content.Load <Texture2D>("HealthBar"), new Vector2(10, 460), Content.Load <SpriteFont>("Controll")); player = new PlayerShip(Content.Load <Texture2D>("SapceShip"), new Vector2(100, 150)); events = new Events(Content.Load <Texture2D>("SpaceStation"), Content.Load <Texture2D>("Planet"), new Vector2(600, 380), Content.Load <SpriteFont>("Controll")); enemy = new Enemy(Content.Load <Texture2D>("LucasShip"), new Vector2(600, 380)); Alvin = Content.Load <SpriteFont>("Controll"); controll = new Controlls(Content.Load <SpriteFont>("Controll")); cards = new CardShower(Content.Load <Texture2D>("CardBase"), Content.Load <SpriteFont>("Controll"), new Vector2(10, 10)); cards.LoadFigures(Content.Load <Texture2D>("GreenSlime"), Content.Load <Texture2D>("Snake")); // TODO: use this.Content to load your game content here }
public void Update() { MouseState mState = Mouse.GetState(); x = mState.X; y = mState.Y; if (mState.LeftButton == ButtonState.Pressed && oldMState.LeftButton == ButtonState.Released && active == true) { if (x > 739 && x < 761 && y > 29 && y < 51) // Avstägning { active = false; } else if (x > 59 && x < 226 && y > 59 && y < 311) // Avstägning { cards = CardShower.Create(); } } oldMState = mState; }