Esempio n. 1
0
        public static void ToDirectory(GameFont extraFont, string dirPath)
        {
            string xmlPath = FileCommander.EnsureDirectoryExists(dirPath, "Characters.xml");

            XmlElement characters = XmlHelper.CreateDocument("Characters");

            foreach (byte width in extraFont.CharactersWidths)
            {
                characters.CreateChildElement("Character").SetByte("Width", width);
            }
            characters.GetOwnerDocument().Save(xmlPath);

            GameImageWriter.ToDirectory(extraFont.CharactersImage, dirPath);
        }
Esempio n. 2
0
        public void WriteBackground(GameImage background)
        {
            XmlElement node = _root.EnsureChildElement("Background");

            node.RemoveAll();

            bool isExists = background != null;

            node.SetBoolean("IsExists", isExists);

            if (!isExists)
            {
                return;
            }

            GameImageWriter.ToDirectory(background, Path.ChangeExtension(_xmlPath, ".bgr"));
        }