use of com.esotericsoftware.spine.Skeleton in project HyperLap2D by rednblackgames.
the class SpineDrawStrategy method updateTile.
@Override
public void updateTile(int entity) {
if (!checkValidTile(entity))
return;
SpineComponent spineComponent = ComponentRetriever.get(entity, SpineComponent.class, tiledPlugin.getAPI().getEngine());
if (!spineComponent.animationName.equals(tiledPlugin.getSelectedTileName())) {
replaceSpineCommandBuilder.begin(entity);
String animName = tiledPlugin.getSelectedTileName();
replaceSpineCommandBuilder.setAnimationName(animName);
SpineDataObject spineDataObject = (SpineDataObject) tiledPlugin.getAPI().getSceneLoader().getRm().getExternalItemType(SpineItemType.SPINE_TYPE, animName);
replaceSpineCommandBuilder.setSkeletonJson(spineDataObject.skeletonJson);
SkeletonData skeletonData = spineDataObject.skeletonData;
replaceSpineCommandBuilder.setSkeleton(new Skeleton(skeletonData));
replaceSpineCommandBuilder.execute(tiledPlugin.facade);
}
}
Aggregations