Ejemplo n.º 1
0
        private static YSpriteFont InternalReadSpriteFont(GraphicsDevice device, BinaryFileReader reader, List<Encoder> encoders)
        {
            Texture2D texture = (Texture2D)InternalReadObject(device, reader, encoders);
            List<Rectangle> glyphBounds = (List<Rectangle>)InternalReadObject(device, reader, encoders);
            List<Rectangle> cropping = (List<Rectangle>)InternalReadObject(device, reader, encoders);
            List<char> characters = (List<char>)InternalReadObject(device, reader, encoders);
            int lineSpacing = reader.ReadInt();
            float spacing = reader.ReadFloat();
            List<Vector3> kerning = (List<Vector3>)InternalReadObject(device, reader, encoders);
            char? defaultChar = null;
            int default_char = (int)reader.ReadCharUTF8();
            if (default_char != 0)
                defaultChar = (char)default_char;

            YSpriteFont ysf = new YSpriteFont(texture, glyphBounds, cropping, characters, lineSpacing, spacing, kerning, defaultChar);
            return ysf;
        }
Ejemplo n.º 2
0
 private static char InternalReadChar(GraphicsDevice device, BinaryFileReader reader, List<Encoder> encoders)
 {
     char c = reader.ReadCharUTF8();
     return c;
 }