public static ATHCompositeImage Create(Game1 game, Vector2 position, Vector2 size, string texture, Anchor anchor = Anchor.topleft, int order = 0)
        {
            ATHCompositeImage ath = new ATHCompositeImage(game, position, size, texture, anchor, order);

            game.Components.Add(ath);
            return(ath);
        }
Example #2
0
        // Méthode test, amusez vous
        public static void CreateATHTest(Game1 game)
        {
            ATHCompositeColor  ath    = ATHCompositeColor.Create(game, new Vector2(0, 0), new Vector2(0, 0), Color.Red);
            ATHCompositeButton button = ATHCompositeButton.Create(ath, new Vector2(50, -100), new Vector2(500, 200), Anchor.center, 0);

            ATHFeuilleColor.Create(button, new Vector2(0, 0), new Vector2(0, 0), Color.Aqua, Anchor.topleft, 0);
            ATHFeuilleColor.Create(button, new Vector2(0, 0), new Vector2(20, 20), Color.Red, Anchor.topleft, 0);
            ATHFeuilleColor.Create(button, new Vector2(20, 20), new Vector2(0, 0), Color.Blue, Anchor.center, 0);
            ATHFeuilleText.Create(button, new Vector2(20, 20), new Vector2(0, 0), "test centre", Color.Black, 1, Anchor.center, Anchor.center);
            ATHFeuilleText.Create(button, new Vector2(20, 0), new Vector2(0, 0), "test gauche", Color.Black, 1, Anchor.left, Anchor.left);
            ATHFeuilleText.Create(button, new Vector2(-20, 0), new Vector2(0, 0), "test droite", Color.Black, 1, Anchor.right, Anchor.right);
            ATHFeuilleText.Create(button, new Vector2(0, -20), new Vector2(0, 0), "test bas", Color.Black, 1, Anchor.bottom, Anchor.bottom);
            ATHFeuilleText.Create(button, new Vector2(0, 20), new Vector2(0, 0), "test haut", Color.Black, 1, Anchor.top, Anchor.top);
            ATHFeuilleText.Create(button, new Vector2(20, 20), new Vector2(0, 0), "test haut gauche", Color.Black, 1, Anchor.topleft, Anchor.topleft);
            ATHFeuilleText.Create(button, new Vector2(-20, 20), new Vector2(0, 0), "test haut droite", Color.Black, 1, Anchor.topright, Anchor.topright);
            ATHFeuilleText.Create(button, new Vector2(20, -20), new Vector2(0, 0), "test bas gauche", Color.Black, 1, Anchor.bottomleft, Anchor.bottomleft);
            ATHFeuilleText.Create(button, new Vector2(-20, -20), new Vector2(0, 0), "test bas droite", Color.Black, 1, Anchor.bottomright, Anchor.bottomright);

            ATHCompositeColor test = ATHCompositeColor.Create(ath, new Vector2(20, 20), new Vector2(100, 50), Color.AntiqueWhite, Anchor.topleft, 5);

            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test hautgauche", Color.Black, 0.5f, Anchor.center, Anchor.center);

            test = ATHCompositeColor.Create(ath, new Vector2(0, 20), new Vector2(100, 50), Color.AntiqueWhite, Anchor.top, 5);
            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test haut", Color.Black, 0.5f, Anchor.center, Anchor.center);

            test = ATHCompositeColor.Create(ath, new Vector2(-20, 20), new Vector2(100, 50), Color.AntiqueWhite, Anchor.topright, 5);
            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test hautdroite", Color.Black, 0.5f, Anchor.center, Anchor.center);

            test = ATHCompositeColor.Create(ath, new Vector2(-20, 0), new Vector2(100, 50), Color.AntiqueWhite, Anchor.right, 5);
            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test droite", Color.Black, 0.5f, Anchor.center, Anchor.center);

            test = ATHCompositeColor.Create(ath, new Vector2(-20, -20), new Vector2(100, 50), Color.AntiqueWhite, Anchor.bottomright, 5);
            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test basdroite", Color.Black, 0.5f, Anchor.center, Anchor.center);

            test = ATHCompositeColor.Create(ath, new Vector2(0, -20), new Vector2(100, 50), Color.AntiqueWhite, Anchor.bottom, 5);
            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test bas", Color.Black, 0.5f, Anchor.center, Anchor.center);

            test = ATHCompositeColor.Create(ath, new Vector2(20, -20), new Vector2(100, 50), Color.AntiqueWhite, Anchor.bottomleft, 5);
            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test basgauche", Color.Black, 0.5f, Anchor.center, Anchor.center);

            test = ATHCompositeColor.Create(ath, new Vector2(20, 0), new Vector2(100, 50), Color.AntiqueWhite, Anchor.left, 5);
            ATHFeuilleText.Create(test, new Vector2(10, 10), new Vector2(0, 0), "test gauche", Color.Black, 0.5f, Anchor.center, Anchor.center);

            ATHCompositeImage test2 = ATHCompositeImage.Create(ath, new Vector2(10, 0), new Vector2(50, 50), "bouton", Anchor.left, 6);

            test2 = ATHCompositeImage.Create(ath, new Vector2(-10, 0), new Vector2(50, 50), "bouton", Anchor.right, 4);
            test2 = ATHCompositeImage.Create(ath, new Vector2(0, 10), new Vector2(50, 50), "bouton", Anchor.top, 1);
            test2 = ATHCompositeImage.Create(ath, new Vector2(0, -10), new Vector2(50, 50), "bouton", Anchor.bottom, 8);
            test2 = ATHCompositeImage.Create(ath, new Vector2(10, 10), new Vector2(50, 50), "bouton", Anchor.topleft, 6);
            test2 = ATHCompositeImage.Create(ath, new Vector2(-10, 10), new Vector2(50, 50), "bouton", Anchor.topright, 4);
            test2 = ATHCompositeImage.Create(ath, new Vector2(10, -10), new Vector2(50, 50), "bouton", Anchor.bottomleft, 2);
            test2 = ATHCompositeImage.Create(ath, new Vector2(-10, -10), new Vector2(50, 50), "bouton", Anchor.bottomright, 6);
        }