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); }
//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 + "->"; Position = xp.GetVector2(rootnode + "Position", Vector2.Zero); Angle = xp.GetFloat(rootnode + "Angle", 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); }
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(); }
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); }