textureFilesFromAtlas static method

Future<List<String>> textureFilesFromAtlas(
  1. String pathToAtlas
)

Implementation

static Future<List<String>> textureFilesFromAtlas(String pathToAtlas) async {
  final String data = await rootBundle.loadString(pathToAtlas);
  final core.TextureAtlasReader reader = core.TextureAtlasReader(data);
  final List<String> r = <String>[];
  for (;;) {
    String? line = reader.readLine();
    if (line == null) {
      break;
    }

    line = line.trim();
    if (line.isEmpty) {
      continue;
    }

    if (isAllowedImageFileName(line)) {
      r.add(line);
    }
  }

  return r;
}