コード例 #1
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);
 }
コード例 #2
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;
                }
            }
        }
コード例 #3
0
ファイル: Body.cs プロジェクト: redcodefinal/EntityEnginev3
 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);
 }
コード例 #4
0
 public override void ParseXml(XmlParser xp, string path)
 {
     base.ParseXml(xp, path);
     string rootnode = path + "->" + Name;
     Texture = EntityGame.Game.Content.Load<Texture2D>(
         xp.GetString(rootnode + "->Texture", "TextureNotSet"));
     TileSize = xp.GetVector2(rootnode + "->TileSize", Vector2.Zero);
 }
コード例 #5
0
 public override void ParseXml(XmlParser xp, string path)
 {
     base.ParseXml(xp, path);
     string rootnode = path + "->" + Name + "->";
     FrameTimer.ParseXml(xp, path + "->" + Name);
     TileSize = xp.GetVector2(rootnode + "TileSize", Vector2.Zero);
     FramesPerSecond = xp.GetInt(rootnode + "FramesPerSecond", 0);
     CurrentFrame = xp.GetInt(rootnode + "CurrentFrame", 0);
     if (xp.GetBool(rootnode + "StartAfterCreation", false))
         Start();
 }
コード例 #6
0
 public override void ParseXml(XmlParser xp, string path)
 {
     base.ParseXml(xp, path);
     string rootnode = path + "->" + Name + "->";
     TileSize = xp.GetVector2(rootnode + "TileSize", Vector2.Zero);
     Index = xp.GetInt(rootnode + "Index", 0);
 }