Esempio n. 1
0
        //public virtual Vector2 Bounds { get; set; }
        public override void ParseXml(XmlParser xp, string path)
        {
            base.ParseXml(xp, path);

            string rootnode = path + "->" + Name;
            Color = xp.GetColor(rootnode + "->Color", Color);
            Alpha = xp.GetFloat(rootnode + "->Alpha", Alpha);
            Scale = xp.GetVector2(rootnode + "->Scale", Scale);
            Layer = xp.GetFloat(rootnode + "->Layer", Layer);

            if (xp.CheckElement(rootnode + "->Flip"))
            {
                string s = xp.GetString(rootnode + "->Flip", "None");
                switch (s)
                {
                    case "None":
                        Flip = SpriteEffects.None;
                        break;

                    case "FlipH":
                        Flip = SpriteEffects.FlipHorizontally;
                        break;

                    case "FlipV":
                        Flip = SpriteEffects.FlipVertically;
                        break;
                }
            }
        }
Esempio n. 2
0
        public override void ParseXml(XmlParser xp, string path)
        {
            base.ParseXml(xp, path);
            string rootnode = path + "->" + Name;

            if (xp.CheckElement(rootnode + "->Texture"))
            {
                LoadTexture(xp.GetString(rootnode + "->Texture", "TEXTURENOTSET"));
            }
        }
        public override void ParseXml(XmlParser xp, string path)
        {
            base.ParseXml(xp, path);

            string rootnode = path + "->" + Name;
            if (xp.CheckElement(rootnode + "->Texture"))
            {
                Texture =
                    EntityGame.Game.Content.Load<Texture2D>(xp.GetString(rootnode + "->Texture",
                                                                                      "TEXTURENOTSET"));
            }

            if (xp.CheckElement(rootnode + "->Colors"))
            {
                string[] test = xp.GetAllDesendents(rootnode + "->Colors");
                foreach (string s in test)
                {
                    Colors.Add(xp.GetColor(rootnode + "->Colors->" + s));
                }
            }
        }