Support TexturePacker image atlases

This commit is contained in:
gem
2026-06-09 12:49:01 +08:00
parent e2a584d4dc
commit 38f6e0c0c9
16 changed files with 343 additions and 26 deletions

View File

@@ -222,8 +222,15 @@ class GameResource {
'spine resource.skeleton must be a non-empty string',
);
}
} else if (path is! String || path.isEmpty) {
throw const FormatException('resource.path must be a non-empty string');
} else {
if (path is! String || path.isEmpty) {
throw const FormatException('resource.path must be a non-empty string');
}
if (atlas != null && (atlas is! String || atlas.isEmpty)) {
throw const FormatException(
'image resource.atlas must be a non-empty string',
);
}
}
final preload = map['preload'] as String? ?? GameResourcePreload.required;
if (!GameResourcePreload.isSupported(preload)) {