An animation phase
Inheritance: IXmlSerializable
Exemple #1
0
 public GridElement(int id, string tooltip, VisibleObject icon, bool Checked, bool enabled = true, int flash = 0)
 {
     _id = id;
     _tooltip = tooltip;
     _icon = icon;
     _checked = Checked;
     _flash = flash;
     _enabled = enabled;
 }
        /// <summary>
        /// Get XML-data from a file
        /// </summary>
        /// <param name="reader">The file from which data will be read</param>
        public void ReadXml(System.Xml.XmlReader reader)
        {
            reader.MoveToContent();
            Boolean isEmptyElement = reader.IsEmptyElement;

            _width = Int32.Parse(reader.GetAttribute("width"));
            _height = Int32.Parse(reader.GetAttribute("height"));
            _loop = Boolean.Parse(reader.GetAttribute("loop"));

            reader.Read();

            if (isEmptyElement) return;

            reader.ReadStartElement("animations");
            if (isEmptyElement) return;

            while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
            {
                VisibleObject temp = new VisibleObject(_content, "", Rectangle.Empty);
                temp.ReadXml(reader);
                _animations.Add(temp);
                reader.Read();
            }

            reader.ReadEndElement();
            if (reader.NodeType == System.Xml.XmlNodeType.EndElement)
                reader.ReadEndElement();
        }
Exemple #3
0
 public GridElement(int id, string tooltip, Backend.ImageData icon, ContentManager content, bool Checked, bool enabled = true, int flash = 0)
 {
     _id = id;
     _tooltip = tooltip;
     _icon = new VisibleObject(content,icon.name,icon.rect,icon.offset,icon.crop);
     _checked = Checked;
     _flash = flash;
     _enabled = enabled;
 }