コード例 #1
0
ファイル: Menu.cs プロジェクト: Ayro64/yellokiller
        public void Draw(SpriteBatch spriteBatch, Ascenseur ascenseurDroit, int limite)
        {
            for (int u = 0; u < NombreTexturesDroite; u++)
            {
                if (ServiceHelper.Get<IMouseService>().Rectangle().Intersects(listeRectanglesDroite[u]))
                {
                    spriteBatch.Draw(fond, new Vector2(listeRectanglesDroite[u].X + 28 * (1 - listeTexturesDroite[u].Width / 28) - 2, listeRectanglesDroite[u].Y + 28 * (1 - listeTexturesDroite[u].Height / 28) - 2), null, Color.White, 0, Vector2.Zero, new Vector2(1 + 0.88f * (listeTexturesDroite[u].Width / 28 - 1), 1 + 0.88f * (listeTexturesDroite[u].Height / 28 - 1)), SpriteEffects.None, 0);
                    spriteBatch.Draw(listeTexturesDroite[u], new Vector2(listeRectanglesDroite[u].X + 28 * (1 - listeTexturesDroite[u].Width / 28), listeRectanglesDroite[u].Y + 28 * (1 - listeTexturesDroite[u].Height / 28)), Color.White);
                }
                else
                    spriteBatch.Draw(listeTexturesDroite[u], new Vector2(limite - 56, -2 * ascenseurDroit.Position.Y + u * 30), null, Color.White, 0, Vector2.Zero, new Vector2((float)28 / listeTexturesDroite[u].Width, (float)28 / listeTexturesDroite[u].Height), SpriteEffects.None, 0);
            }

            for (int c = 0; c < NombreTexturesGauche; c++)
            {
                if (ServiceHelper.Get<IMouseService>().Rectangle().Intersects(listeRectanglesGauche[c]))
                    spriteBatch.Draw(fond, new Vector2(listeRectanglesGauche[c].X + 28 * (1 - listeTexturesGauche[c].Width / 28) - 2, listeRectanglesGauche[c].Y + 28 * (1 - listeTexturesGauche[c].Height / 28) - 2), null, Color.White, 0, Vector2.Zero, new Vector2(1 + 0.88f * (listeTexturesGauche[c].Width / 28 - 1), 1 + 0.88f * (listeTexturesGauche[c].Height / 28 - 1)), SpriteEffects.None, 0);

                spriteBatch.Draw(listeTexturesGauche[c], new Vector2(listeRectanglesGauche[c].X + 28 * (1 - listeTexturesGauche[c].Width / 28), listeRectanglesGauche[c].Y + 28 * (1 - listeTexturesGauche[c].Height / 28)), Color.White);
            }
        }
コード例 #2
0
ファイル: Menu.cs プロジェクト: Ayro64/yellokiller
 public void Update(Ascenseur ascenseurDroit, int limite)
 {
     for (int i = 0; i < NombreTexturesDroite; i++)
         listeRectanglesDroite[i] = new Rectangle(limite/* Taille_Ecran.LARGEUR_ECRAN*/ - 56, 2 * (int)-ascenseurDroit.Position.Y + i * 30, 28, 28);
 }
コード例 #3
0
ファイル: EditorScreen.cs プロジェクト: Ayro64/yellokiller
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");

            menu = new Menu(content);
            curseur = new Curseur(content);
            ascenseur = new Ascenseur(content, ScreenManager.GraphicsDevice.Viewport.Width - 28);
            fond = content.Load<Texture2D>(@"Textures\Invisible");
            pointDePassage = content.Load<Texture2D>(@"Menu Editeur de Maps\pied");
            textureStatue = content.Load<Texture2D>(@"Feuilles de sprites\statue_dragon");
            textureBasFond = content.Load<Texture2D>("Bas fond");
            infos = new Informations();
            infos.LoadContent(content);

            foreach (Interrupteur bouton in interrupteurs)
                bouton.LoadContent(content);

            spriteBatch = ScreenManager.SpriteBatch;
        }