示例#1
0
        private bool MouseHover(HamasSprite member)
        {
            Vector2 pos       = member.GetPos();
            var     dest      = new Rectangle((int)pos.X, (int)pos.Y, 165, 165);
            bool    mouseover = dest.Contains((int)lastMousePosition.X, (int)lastMousePosition.Y);

            return(mouseover);
        }
示例#2
0
        public void Update(GameTime gameTime, HamasSprite sp)
        {
            MouseState ms = Mouse.GetState();

            x = ms.X;
            bool clicked = false;

            y   = ms.Y;
            pos = new Vector2(x, y);
        }
示例#3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            /*טעינת תוכן*/
            //mainCrusor = new MainCursor(Content.Load<Texture2D>("cursorgreen"), Content.Load<Texture2D>("cursorred"), Content.Load<Song>("M16Sound"));
            // ObjectCreated();
            sword      = new Sword(Content);
            gun        = new Gun(Content);
            gameback   = Content.Load <Texture2D>("back");
            font       = Content.Load <SpriteFont>("font");
            startgame  = new HamasSprite(Content, 1);
            btnexit    = new XNAButton(Content.Load <Texture2D>("exit"), new Vector2(420, 512), Content.Load <Texture2D>("exithover"), this);
            btnstart   = new XNAButton(Content.Load <Texture2D>("startmenu"), new Vector2(500, 500), Content.Load <Texture2D>("startmenuhover"), this);
            Background = Content.Load <Texture2D>("NEWBACK");
            Song song = Content.Load <Song>("music");  // Put the name of your song in instead of "song_title"

            //     MediaPlayer.Play(song);
            zenmode = new HamasSprite(Content, 2);
            Menu.Add(zenmode);
            Menu.Add(startgame);
            MediaPlayer.IsRepeating = true;
            // TODO: use this.Content to load your game content here
        }