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;
                }
            }
        }
Exemplo n.º 2
0
 public override void ParseXml(XmlParser xp, string path)
 {
     base.ParseXml(xp, path);
     string rootnode = path + "->" + Name;
     Drag = xp.GetFloat(rootnode + "->Drag", Drag);
     AngularVelocity = xp.GetFloat(rootnode + "->AngularVelocity", AngularVelocity);
     Velocity = xp.GetVector2(rootnode + "->Velocity", Velocity);
     Acceleration = xp.GetVector2(rootnode + "->Acceleration", Acceleration);
 }
Exemplo n.º 3
0
 public override void ParseXml(XmlParser xp, string path)
 {
     base.ParseXml(xp, path);
     string rootnode = path + "->" + Name + "->";
     Position = xp.GetVector2(rootnode + "Position", Vector2.Zero);
     Angle = xp.GetFloat(rootnode + "Angle", 0);
 }
Exemplo n.º 4
0
 public override void ParseXml(XmlParser xp, string path)
 {
     base.ParseXml(xp, path);
     string rootnode = path + "->" + Name;
     _rapidfire = xp.GetFloat(rootnode + "->RapidfireMilliseconds", 0);
 }
Exemplo n.º 5
0
        public override void ParseXml(XmlParser xp, string path)
        {
            base.ParseXml(xp, path);
            string rootnode = path + "->" + Name + "->";

            SoundEffect = LoadSound(xp.GetString(rootnode + "SoundEffect", "SoundNotSet")).CreateInstance();
            Volume = xp.GetFloat(rootnode + "Volume", 1);
            Pan = xp.GetFloat(rootnode + "Pan", 0);
            Pitch = xp.GetFloat(rootnode + "Pitch", 0);
            Loop = xp.GetBool(rootnode + "Loop", false);
        }