Exemplo n.º 1
0
        protected override void ReadXml(XElement xImage)
        {
            Format      = (string)xImage.Attribute("format");
            Source      = (string)xImage.Attribute("source");
            Transparent = new TiledColor((string)xImage.Attribute("trans"));
            Width       = (int)xImage.Attribute("width");
            Height      = (int)xImage.Attribute("height");
            var data = xImage.Element("data");

            if (data != null)
            {
                EmbeddedData = new TiledData(data);
            }
        }
Exemplo n.º 2
0
        protected override void ReadXml(XElement xLayer)
        {
            Name     = (string)xLayer.Attribute("name");
            Width    = (int)xLayer.Attribute("width");
            Height   = (int)xLayer.Attribute("height");
            _opacity = (float?)xLayer.Attribute("opacity") ?? 1f;
            _offsetX = (int?)xLayer.Attribute("offsetx") ?? 0;
            _offsetY = (int?)xLayer.Attribute("offsety") ?? 0;

            var visible = xLayer.Attribute("visible");

            _visible = visible == null ? true : (int)visible == 1;

            var properties = xLayer.Element("properties");

            Properties = ReadProperties(properties);

            Data = new TiledData(xLayer.Element("data"));
        }