use of com.bladecoder.engine.model.Sprite3DRenderer in project bladecoder-adventure-engine by bladecoder.
the class EditAnimationDialog method setSource.
private void setSource() {
AnimationDesc anim = null;
ActorRenderer renderer = parent.getRenderer();
String sourceStr = source.getText();
if (renderer instanceof SpineRenderer) {
anim = new SpineAnimationDesc();
if (spineAtlasExists(sourceStr)) {
((SpineAnimationDesc) anim).atlas = null;
setVisible(atlas, false);
} else {
if (!atlas.isVisible()) {
setVisible(atlas, true);
}
((SpineAnimationDesc) anim).atlas = atlas.getText();
}
} else if (renderer instanceof AtlasRenderer) {
anim = new AtlasAnimationDesc();
} else {
anim = new AnimationDesc();
}
anim.source = sourceStr;
anim.count = Tween.INFINITY;
anim.preload = true;
anim.disposeWhenPlayed = false;
if (renderer instanceof SpineRenderer) {
spriteWidget.setSource(Project.SPINE_RENDERER_STRING, anim);
} else if (renderer instanceof AtlasRenderer) {
spriteWidget.setSource(Project.ATLAS_RENDERER_STRING, anim);
} else if (renderer instanceof ImageRenderer) {
spriteWidget.setSource(Project.IMAGE_RENDERER_STRING, anim);
} else if (renderer instanceof Sprite3DRenderer) {
spriteWidget.setSource(Project.S3D_RENDERER_STRING, anim);
}
}
Aggregations