Search in sources :

Example 1 with TextureRegionDrawable

use of com.talosvfx.talos.runtime.render.drawables.TextureRegionDrawable in project talos by rockbite.

the class RibbonModule method processValues.

@Override
public void processValues() {
    RibbonRenderer renderer = (RibbonRenderer) outputValue.getDrawable();
    TextureRegion mainRegion = null;
    TextureRegion ribbonRegion = null;
    if (!mainDrawableValue.isEmpty() && mainDrawableValue.getDrawable() != null) {
        mainRegion = mainDrawableValue.getDrawable().getTextureRegion();
    }
    if (!ribbonDrawableValue.isEmpty() && ribbonDrawableValue.getDrawable() != null) {
        if (ribbonDrawableValue.getDrawable() instanceof TextureRegionDrawable) {
            ribbonRegion = ribbonDrawableValue.getDrawable().getTextureRegion();
        } else if (ribbonDrawableValue.getDrawable() instanceof ShadedDrawable) {
            renderer.setShadedDrawable((ShadedDrawable) ribbonDrawableValue.getDrawable());
        }
    }
    renderer.setRegions(mainRegion, ribbonRegion);
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ShadedDrawable(com.talosvfx.talos.runtime.render.drawables.ShadedDrawable) RibbonRenderer(com.talosvfx.talos.runtime.render.drawables.RibbonRenderer) TextureRegionDrawable(com.talosvfx.talos.runtime.render.drawables.TextureRegionDrawable)

Aggregations

TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 RibbonRenderer (com.talosvfx.talos.runtime.render.drawables.RibbonRenderer)1 ShadedDrawable (com.talosvfx.talos.runtime.render.drawables.ShadedDrawable)1 TextureRegionDrawable (com.talosvfx.talos.runtime.render.drawables.TextureRegionDrawable)1