Search in sources :

Example 1 with AbstractShaderNode

use of com.talosvfx.talos.editor.addons.shader.nodes.AbstractShaderNode in project talos by rockbite.

the class UIKit method create.

@Override
public void create() {
    super.create();
    TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("skin/uiskin.atlas"));
    skin = new Skin(Gdx.files.internal("skin/uiskin.json"));
    skin.addRegions(atlas);
    table = new Table();
    AbstractShaderNode shaderNode = new AbstractShaderNode() {

        @Override
        public void prepareDeclarations(ShaderBuilder shaderBuilder) {
        }

        @Override
        public String writeOutputCode(String slotId) {
            return null;
        }
    };
    shaderNode.init(skin, null);
    XmlReader reader = new XmlReader();
    XmlReader.Element root = reader.parse(Gdx.files.internal("addons/shader/nodes.xml"));
    shaderNode.constructNode(root.getChild(0).getChild(0));
    table.add(shaderNode);
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);
    table.setFillParent(true);
    stage.addActor(table);
}
Also used : Table(com.badlogic.gdx.scenes.scene2d.ui.Table) ShaderBuilder(com.talosvfx.talos.runtime.shaders.ShaderBuilder) TextureAtlas(com.badlogic.gdx.graphics.g2d.TextureAtlas) Stage(com.badlogic.gdx.scenes.scene2d.Stage) Skin(com.badlogic.gdx.scenes.scene2d.ui.Skin) XmlReader(com.badlogic.gdx.utils.XmlReader) AbstractShaderNode(com.talosvfx.talos.editor.addons.shader.nodes.AbstractShaderNode)

Aggregations

TextureAtlas (com.badlogic.gdx.graphics.g2d.TextureAtlas)1 Stage (com.badlogic.gdx.scenes.scene2d.Stage)1 Skin (com.badlogic.gdx.scenes.scene2d.ui.Skin)1 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)1 XmlReader (com.badlogic.gdx.utils.XmlReader)1 AbstractShaderNode (com.talosvfx.talos.editor.addons.shader.nodes.AbstractShaderNode)1 ShaderBuilder (com.talosvfx.talos.runtime.shaders.ShaderBuilder)1