コード例 #1
0
        public override void ParseXml(XmlParser xp, string path)
        {
            base.ParseXml(xp, path);
            string rootnode = path + "->" + Name + "->";

            LoadFont(xp.GetString(rootnode + "Font", "FontNotSet"));
            Text = xp.GetString(rootnode + "Text", "");
        }
コード例 #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
 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);
 }
コード例 #4
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"));
            }
        }
コード例 #5
0
        public override void ParseXml(XmlParser xp, string path)
        {
            base.ParseXml(xp, path);

            string s = xp.GetString(path + "->Stick", Stick.ToString());
            if (s == "Left")
            {
                Stick = Sticks.Left;
            }
            else if (s == "Right")
            {
                Stick = Sticks.Right;
            }

            PlayerIndex = (PlayerIndex)xp.GetInt(path + "->PlayerIndex", (int)PlayerIndex);
        }
コード例 #6
0
        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));
                }
            }
        }
コード例 #7
0
ファイル: Sound.cs プロジェクト: redcodefinal/EntityEnginev3
        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);
        }