TexturePackerFileReader.cs 644 B

1234567891011121314151617181920212223
  1. // Copyright (c) Craftwork Games. All rights reserved.
  2. // Licensed under the MIT license.
  3. // See LICENSE file in the project root for full license information.
  4. using System.IO;
  5. using System.Text.Json;
  6. namespace MonoGame.Extended.Content.TexturePacker;
  7. internal static class TexturePackerFileReader
  8. {
  9. internal static TexturePackerFileContent Read(string path)
  10. {
  11. using var stream = File.OpenRead(path);
  12. return Read(stream);
  13. }
  14. internal static TexturePackerFileContent Read(Stream stream)
  15. {
  16. var tpFile = JsonSerializer.Deserialize<TexturePackerFileContent>(stream);
  17. return tpFile;
  18. }
  19. }