/// <inheritdoc />
 public override Vector3 ReadContext(ContentSerializationContext context)
 {
     return(new Vector3
     {
         X = context.Get <float>(nameof(Vector3.X)),
         Y = context.Get <float>(nameof(Vector3.Y)),
         Z = context.Get <float>(nameof(Vector3.Z))
     });
 }
 /// <inheritdoc />
 public override SpriteFont.Kerning ReadContext(ContentSerializationContext context)
 {
     return(new SpriteFont.Kerning
     {
         First = context.Get <int>(nameof(SpriteFont.Kerning.First)),
         Second = context.Get <int>(nameof(SpriteFont.Kerning.Second)),
         Offset = context.Get <int>(nameof(SpriteFont.Kerning.Offset))
     });
 }
예제 #3
0
 /// <inheritdoc />
 public override Color ReadContext(ContentSerializationContext context)
 {
     return(new Color
     {
         A = context.Get <byte>(nameof(Color.A)),
         R = context.Get <byte>(nameof(Color.R)),
         G = context.Get <byte>(nameof(Color.G)),
         B = context.Get <byte>(nameof(Color.B))
     });
 }
 /// <inheritdoc />
 public override Rectangle ReadContext(ContentSerializationContext context)
 {
     return(new Rectangle
     {
         X = context.Get <int>(nameof(Rectangle.X)),
         Y = context.Get <int>(nameof(Rectangle.Y)),
         Width = context.Get <int>(nameof(Rectangle.Width)),
         Height = context.Get <int>(nameof(Rectangle.Height))
     });
 }
 /// <inheritdoc />
 public override SpriteFont.Glyph ReadContext(ContentSerializationContext context)
 {
     return(new SpriteFont.Glyph
     {
         Character = context.Get <int>(nameof(SpriteFont.Glyph.Character)),
         Subrect = context.Get <Rectangle>(nameof(SpriteFont.Glyph.Subrect)),
         OffsetX = context.Get <int>(nameof(SpriteFont.Glyph.OffsetX)),
         OffsetY = context.Get <int>(nameof(SpriteFont.Glyph.OffsetY)),
         XAdvance = context.Get <int>(nameof(SpriteFont.Glyph.XAdvance))
     });
 }
 /// <inheritdoc />
 public override SpriteFont ReadContext(ContentSerializationContext context)
 {
     return(new SpriteFont
     {
         Face = context.Get <string>(nameof(SpriteFont.Face)),
         Size = context.Get <int>(nameof(SpriteFont.Size)),
         Bold = context.Get <bool>(nameof(SpriteFont.Bold)),
         Italic = context.Get <bool>(nameof(SpriteFont.Italic)),
         DefaultCharacter = context.Get <int>(nameof(SpriteFont.DefaultCharacter)),
         LineSpacing = context.Get <int>(nameof(SpriteFont.LineSpacing)),
         SpacingX = context.Get <int>(nameof(SpriteFont.SpacingX)),
         SpacingY = context.Get <int>(nameof(SpriteFont.SpacingY)),
         Glyphs = context.Get <Dictionary <int, SpriteFont.Glyph> >(nameof(SpriteFont.Glyphs)),
         Kernings = context.Get <Dictionary <int, SpriteFont.Kerning> >(nameof(SpriteFont.Kernings)),
         ImageData = System.Convert.FromBase64String(context.Get <string>(nameof(SpriteFont.ImageData)))
     });
 }