Search in sources :

Example 6 with Sprite3DRenderer

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);
    }
}
Also used : AtlasAnimationDesc(com.bladecoder.engine.anim.AtlasAnimationDesc) SpineAnimationDesc(com.bladecoder.engine.anim.SpineAnimationDesc) ImageRenderer(com.bladecoder.engine.model.ImageRenderer) AtlasRenderer(com.bladecoder.engine.model.AtlasRenderer) Sprite3DRenderer(com.bladecoder.engine.model.Sprite3DRenderer) AnimationDesc(com.bladecoder.engine.anim.AnimationDesc) AtlasAnimationDesc(com.bladecoder.engine.anim.AtlasAnimationDesc) SpineAnimationDesc(com.bladecoder.engine.anim.SpineAnimationDesc) SpineRenderer(com.bladecoder.engine.spine.SpineRenderer) ActorRenderer(com.bladecoder.engine.model.ActorRenderer)

Aggregations

AtlasRenderer (com.bladecoder.engine.model.AtlasRenderer)6 ImageRenderer (com.bladecoder.engine.model.ImageRenderer)6 Sprite3DRenderer (com.bladecoder.engine.model.Sprite3DRenderer)6 SpineRenderer (com.bladecoder.engine.spine.SpineRenderer)6 Vector2 (com.badlogic.gdx.math.Vector2)4 ActorRenderer (com.bladecoder.engine.model.ActorRenderer)4 SpriteActor (com.bladecoder.engine.model.SpriteActor)3 AnchorActor (com.bladecoder.engine.model.AnchorActor)2 CharacterActor (com.bladecoder.engine.model.CharacterActor)2 InteractiveActor (com.bladecoder.engine.model.InteractiveActor)2 ObstacleActor (com.bladecoder.engine.model.ObstacleActor)2 ParticleRenderer (com.bladecoder.engine.model.ParticleRenderer)2 TextRenderer (com.bladecoder.engine.model.TextRenderer)2 Polygon (com.badlogic.gdx.math.Polygon)1 AnimationDesc (com.bladecoder.engine.anim.AnimationDesc)1 AtlasAnimationDesc (com.bladecoder.engine.anim.AtlasAnimationDesc)1 SpineAnimationDesc (com.bladecoder.engine.anim.SpineAnimationDesc)1 AnimationRenderer (com.bladecoder.engine.model.AnimationRenderer)1 BaseActor (com.bladecoder.engine.model.BaseActor)1 SceneLayer (com.bladecoder.engine.model.SceneLayer)1