public Bouton(Texture2D texture, Vector2 position, TypeBouton type) { this.texture = texture; this.position = position; bouton = new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height); this.Type = type; }
/** * Constructeur avec parametres * @param x : position du bouton en x * @param y : position du bouton en y * @param up : chemin relatif de l'image du bouton non appuye * @param hover : chemin relatif de l'image du bouton survol * @param son : recuperation du son */ public BoutonTexture(float posX, float posY, TypeBouton normal, TypeBouton hover, TypeBouton appuyer) : base(posX, posY) { mSprtNormal = Ins.GetSpriteBouton(normal); mSprtHover = Ins.GetSpriteBouton(hover); mSprtAppuyer = Ins.GetSpriteBouton(appuyer); mSprtNormal.Position = new Vector2f(mPositionX, mPositionY); mSprtHover.Position = new Vector2f(mPositionX, mPositionY); mSprtAppuyer.Position = new Vector2f(mPositionX, mPositionY); }
public Bouton(Game game, Color couleurClic, Color couleurNonClic, int indice, string texte, SpriteFont font, TypeBouton typeBouton) : base(game) { GestionSprite = Game.Services.GetService(typeof(SpriteBatch)) as SpriteBatch; GestionInput = Game.Services.GetService(typeof(InputManager)) as InputManager; CouleurClic = couleurClic; CouleurNonClic = couleurNonClic; Indice = indice; Texte = texte; Font = font; TypeBouton = typeBouton; }
public Sprite GetSpriteBouton(TypeBouton bouton) { return(m_sBoutons[(int)bouton]); }
private static bool EstTypeBouton(this Joueur j, TypeBouton bouton) { return((j.Bouton & bouton) == bouton); }
private string RechercherTypeBouton(List <Joueur> listeJoueur, TypeBouton typeBouton) { return((from j in listeJoueur where ((j.Bouton & typeBouton) == typeBouton) select j.Nom).First <string>()); }