예제 #1
0
파일: option.cs 프로젝트: tchiiikun/Templar
 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);
 }
예제 #2
0
파일: BUTTON.cs 프로젝트: tchiiikun/Templar
 public void Update(MouseEvent mouse)
 {
     if (Bouton.Intersects(mouse.getMousecontainer()))
         click_down = true;
 }
예제 #3
0
파일: option.cs 프로젝트: kylox/Templar
        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);
        }
예제 #4
0
파일: option.cs 프로젝트: kylox/Templar
 private void click_down(MouseEvent mouse)
 {
 }