public option(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D _texture) : base(game, spriteBatch) { string[] menuItems = { "plein ecran", "fenetre", "activer son", "desactiver son", "retour au menu principale" }; plus = new BUTTON(ressource.plus, new Rectangle(game.Window.ClientBounds.Height / 2, game.Window.ClientBounds.Width / 2, 10, 10)); moin = new BUTTON(ressource.moin, new Rectangle(game.Window.ClientBounds.Height / 2, game.Window.ClientBounds.Width / 2 + 15, 10, 10)); mouse = new MouseEvent(); this.texture = _texture; menugenrale = new menugenerale(game, spriteBatch, spriteFont, menuItems); compenents.Add(menugenrale); rectangle = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height); }
public void Update(MouseEvent mouse) { if (Bouton.Intersects(mouse.getMousecontainer())) click_down = true; }
public option(Game game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D _texture, bool language) : base(game, spriteBatch) { langue = language; XmlReader reader; reader = XmlReader.Create("Francais.xml"); if (!language) { reader = XmlReader.Create("English.xml"); } string op1 = "", op2 = "", op3 = "", op4 = "", op5 = "", op6 = ""; while (reader.Read()) while (reader.NodeType != XmlNodeType.EndElement) { reader.Read(); if (reader.Name == "pleinecran") { while (reader.NodeType != XmlNodeType.EndElement) { reader.Read(); if (reader.NodeType == XmlNodeType.Text) op1 = reader.Value.ToString(); } reader.Read(); } if (reader.Name == "fenetre") { while (reader.NodeType != XmlNodeType.EndElement) { reader.Read(); if (reader.NodeType == XmlNodeType.Text) op2 = reader.Value.ToString(); } reader.Read(); } if (reader.Name == "activer") { while (reader.NodeType != XmlNodeType.EndElement) { reader.Read(); if (reader.NodeType == XmlNodeType.Text) op3 = reader.Value.ToString(); } reader.Read(); } if (reader.Name == "desactiver") { while (reader.NodeType != XmlNodeType.EndElement) { reader.Read(); if (reader.NodeType == XmlNodeType.Text) op4 = reader.Value.ToString(); } reader.Read(); } if (reader.Name == "langue") { while (reader.NodeType != XmlNodeType.EndElement) { reader.Read(); if (reader.NodeType == XmlNodeType.Text) op5 = reader.Value.ToString(); } reader.Read(); } if (reader.Name == "retour") { while (reader.NodeType != XmlNodeType.EndElement) { reader.Read(); if (reader.NodeType == XmlNodeType.Text) op6 = reader.Value.ToString(); } reader.Read(); } } string[] menuItems = { op1, op2, op3, op4, op5, op6 }; plus = new BUTTON(ressource.plus, new Rectangle(game.Window.ClientBounds.Height / 2, game.Window.ClientBounds.Width / 2, 10, 10)); moin = new BUTTON(ressource.moin, new Rectangle(game.Window.ClientBounds.Height / 2, game.Window.ClientBounds.Width / 2 + 15, 10, 10)); mouse = new MouseEvent(); this.texture = _texture; menugenrale = new menugenerale(game, spriteBatch, spriteFont, menuItems); compenents.Add(menugenrale); rectangle = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height); }
private void click_down(MouseEvent mouse) { }