Esempio n. 1
0
        // Constructeur avec parent
        protected ATH(ATH parent, Vector2 position, Vector2 size, Anchor anchor = Anchor.topleft, int order = 0) : base(parent.game)
        {
            this.parent   = parent;
            this.position = position;
            this.size     = size;
            this.anchor   = anchor;
            this.game     = parent.game;

            // Gestion de l'ordre d'affichage (plus order est grand, plus il sera appelé tard et donc plus il sera en avant
            // Un enfant passera toujours au dessus d'un parent, d'ou le "+ 1" et sera ensuite replacé en fonction de son order(précisé dans les paramètres du constructeur)
            this.order = (int)(parent.order + 1 + order * 1000 / Math.Pow(10, NbParent()));
            resize(parent.size);
        }
Esempio n. 2
0
        // Constructeur sans parent
        protected ATH(Game1 game, Vector2 position, Vector2 size, Anchor anchor = Anchor.topleft, int order = 0) : base(game)
        {
            // place le parent en null, on considère ici que le parent est game
            this.parent   = null;
            this.position = position;
            this.size     = size;
            this.anchor   = anchor;
            this.game     = game;

            // Gestion de l'ordre d'affichage (plus order est grand, plus il sera appelé tard et donc plus il sera en avant)
            // C'est un peu foireux mais ça marche si le nombre de fils est inférieur à 10 et que il y'a moins de 5 couche d'ath
            this.order = (int)(order * 1000 / Math.Pow(10, NbParent()));
            resize(new Vector2(game.GraphicsDevice.PresentationParameters.BackBufferWidth, game.GraphicsDevice.PresentationParameters.BackBufferHeight));
        }
 protected ATHCompositeImage(ATH parent, Vector2 position, Vector2 size, string texture, Anchor anchor = Anchor.topleft, int order = 0) : base(parent, position, size, anchor, order)
 {
     this.texture = texture;
 }
Esempio n. 4
0
 protected ATHCompositeButton(ATH parent, Vector2 position, Vector2 size, Anchor anchor = Anchor.topleft, int order = 0, ButtonType type = ButtonType.back) : base(parent, position, size, anchor, order)
 {
     this.type = type;
 }
 public ATHFeuilleImage(ATH parent, Vector2 position, Vector2 size, string texture, Anchor anchor = Anchor.topleft, int order = 0) : base(parent, position, size, anchor, order)
 {
     this.texture = texture;
 }
 public ATHFeuilleColor(ATH parent, Vector2 position, Vector2 size, Color color, Anchor anchor = Anchor.topleft, int order = 0) : base(parent, position, size, anchor, order)
 {
     this.anchor = anchor;
     this.color  = color;
 }
 public void Remove(ATH ath)
 {
     this.children.Remove(ath);
 }
 public void Add(ATH ath)
 {
     this.children.Add(ath);
 }
 public ATHComposite(ATH parent, Vector2 position, Vector2 size, Anchor anchor = Anchor.topleft, int order = 0) : base(parent, position, size, anchor, order)
 {
     children = new List <ATH>();
 }