use of games.rednblack.h2d.extension.spine.ResourceRetrieverAttachmentLoader in project HyperLap2D by rednblackgames.
the class ResourceManager method loadCurrentProjectSpineAnimations.
private void loadCurrentProjectSpineAnimations(String path) {
spineAnimAtlases.clear();
FileHandle sourceDir = new FileHandle(path);
SpineDrawableLogic spineDrawableLogic = (SpineDrawableLogic) Sandbox.getInstance().sceneControl.sceneLoader.getExternalItemType(SpineItemType.SPINE_TYPE).getDrawable();
for (FileHandle entry : sourceDir.list()) {
if (entry.file().isDirectory()) {
String animName = FilenameUtils.removeExtension(entry.file().getName());
FileHandle animJsonFile = Gdx.files.internal(entry.file().getAbsolutePath() + File.separator + animName + ".json");
SpineDataObject spineDataObject = new SpineDataObject();
spineDataObject.skeletonJson = new SkeletonJson(new ResourceRetrieverAttachmentLoader(animName, this, spineDrawableLogic));
spineDataObject.skeletonData = spineDataObject.skeletonJson.readSkeletonData(animJsonFile);
spineAnimAtlases.put(animName, spineDataObject);
}
}
}
Aggregations