use of com.talosvfx.talos.editor.addons.scene.logic.components.SpineRendererComponent in project talos by rockbite.
the class SpineImporter method makeInstance.
@Override
public void makeInstance(FileHandle asset, GameObject parent) {
SceneEditorWorkspace workspace = SceneEditorAddon.get().workspace;
Vector2 sceneCords = workspace.getMouseCordsOnScene();
GameObject gameObject = workspace.createObjectByTypeName("spine", sceneCords, parent);
// now do some fancy component configuring from this guy
SpineRendererComponent spineRendererComponent = gameObject.getComponent(SpineRendererComponent.class);
SkeletonComponent skeletonComponent = gameObject.getComponent(SkeletonComponent.class);
SpineMetadata spineMetadata = AssetImporter.readMetadataFor(asset, SpineMetadata.class);
// read this from meta instead later
spineRendererComponent.path = spineMetadata.atlasPath;
skeletonComponent.path = AssetImporter.relative(asset.path());
spineRendererComponent.reloadAtlas();
skeletonComponent.setAtlas(spineRendererComponent.textureAtlas);
skeletonComponent.reloadData(spineMetadata.scale);
}
Aggregations