Esempio n. 1
0
        /// <summary>Loads the frames contained in a skin document</summary>
        /// <param name="skinDocument">
        ///   XML document containing a skin description whose frames will be loaded
        /// </param>
        private void loadFrames(XDocument skinDocument)
        {
            // Load all the frames specified by the skin
            XElement resources = skinDocument.Element("skin").Element("frames");

            foreach (XElement element in resources.Descendants("frame"))
            {
                string name = element.Attribute("name").Value;

                Frame.Region[] regions = RegionListBuilder.Build(element, this.bitmaps);
                Frame.Text[]   texts   = TextListBuilder.Build(element, this.fonts);
                this.frames.Add(name, new Frame(regions, texts));
            }
        }
        /// <summary>Loads the frames contained in a skin document</summary>
        /// <param name="skinDocument">
        ///   XML document containing a skin description whose frames will be loaded
        /// </param>
        private void loadFrames(XmlDocument skinDocument)
        {
            // Extract all frames from the skin
            XmlNodeList frames = skinDocument.SelectNodes("/skin/frames/frame");

            for (int frameIndex = 0; frameIndex < frames.Count; ++frameIndex)
            {
                // Extract the frame's attributes
                string name = frames[frameIndex].Attributes["name"].Value;

                Frame.Region[] regions = RegionListBuilder.Build(frames[frameIndex], this.bitmaps);
                Frame.Text[]   texts   = TextListBuilder.Build(frames[frameIndex], this.fonts);
                this.frames.Add(name, new Frame(regions, texts));
            }
        }