Exemplo 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;
                }
            }
        }
        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));
                }
            }
        }
Exemplo n.º 3
0
 public override void ParseXml(XmlParser xp, string path)
 {
     base.ParseXml(xp, path);
     string rootnode = path + "->" + Name + "->";
     Debug = xp.GetBool(rootnode + "Debug", false);
     DebugColor = xp.GetColor(rootnode + "DebugColor", Color.PowderBlue);
     Bounds = xp.GetRectangle(rootnode + "Bounds", new Rectangle());
 }