Search in sources :

Example 21 with GraphBoxImpl

use of com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl in project gdx-graph by MarcinSc.

the class ShadowShaderRendererBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    GraphBoxImpl result = createGraphBox(id);
    addConfigurationInputsAndOutputs(result);
    EnumSelectBoxPart renderOrderSelect = new EnumSelectBoxPart("Render order", "renderOrder", new ToStringEnum<RenderOrder>(), RenderOrder.values());
    renderOrderSelect.initialize(data);
    result.addGraphBoxPart(renderOrderSelect);
    StringBoxPart envId = new StringBoxPart("Env id: ", "id");
    envId.initialize(data);
    result.addGraphBoxPart(envId);
    ShadowShadersBoxPart graphBoxPart = new ShadowShadersBoxPart();
    graphBoxPart.initialize(data);
    result.addGraphBoxPart(graphBoxPart);
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) EnumSelectBoxPart(com.gempukku.libgdx.graph.ui.part.EnumSelectBoxPart) StringBoxPart(com.gempukku.libgdx.graph.ui.part.StringBoxPart) RenderOrder(com.gempukku.libgdx.graph.pipeline.RenderOrder)

Example 22 with GraphBoxImpl

use of com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl in project gdx-graph by MarcinSc.

the class ParticlesShaderRendererBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    GraphBoxImpl result = createGraphBox(id);
    addConfigurationInputsAndOutputs(result);
    ParticlesShadersBoxPart graphBoxPart = new ParticlesShadersBoxPart();
    graphBoxPart.initialize(data);
    result.addGraphBoxPart(graphBoxPart);
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl)

Example 23 with GraphBoxImpl

use of com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl in project gdx-graph by MarcinSc.

the class EndScreenShaderBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    final ScreenShaderPreviewBoxPart previewBoxPart = new ScreenShaderPreviewBoxPart();
    previewBoxPart.initialize(data);
    GraphBoxImpl result = new GraphBoxImpl(id, getConfiguration()) {

        @Override
        public void graphChanged(GraphChangedEvent event, boolean hasErrors, Graph<? extends GraphNode, ? extends GraphConnection, ? extends GraphProperty> graph) {
            if (event.isData() || event.isStructure()) {
                previewBoxPart.graphChanged(hasErrors, graph);
            }
        }
    };
    addConfigurationInputsAndOutputs(result);
    result.addGraphBoxPart(new SectionBoxPart("Rendering config"));
    BlendingBoxPart blendingBox = new BlendingBoxPart();
    blendingBox.initialize(data);
    result.addGraphBoxPart(blendingBox);
    result.addGraphBoxPart(new SectionBoxPart("Preview"));
    result.addGraphBoxPart(previewBoxPart);
    return result;
}
Also used : GraphProperty(com.gempukku.libgdx.graph.data.GraphProperty) GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) Graph(com.gempukku.libgdx.graph.data.Graph) GraphChangedEvent(com.gempukku.libgdx.graph.ui.graph.GraphChangedEvent) ScreenShaderPreviewBoxPart(com.gempukku.libgdx.graph.plugin.screen.design.ScreenShaderPreviewBoxPart) GraphConnection(com.gempukku.libgdx.graph.data.GraphConnection) BlendingBoxPart(com.gempukku.libgdx.graph.ui.part.BlendingBoxPart) SectionBoxPart(com.gempukku.libgdx.graph.ui.part.SectionBoxPart) GraphNode(com.gempukku.libgdx.graph.data.GraphNode)

Example 24 with GraphBoxImpl

use of com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl in project gdx-graph by MarcinSc.

the class ScreenShaderRendererBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    GraphBoxImpl result = createGraphBox(id);
    addConfigurationInputsAndOutputs(result);
    ScreenShaderBoxPart screenShaderBoxPart = new ScreenShaderBoxPart();
    screenShaderBoxPart.initialize(data);
    result.addGraphBoxPart(screenShaderBoxPart);
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl)

Example 25 with GraphBoxImpl

use of com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl in project gdx-graph by MarcinSc.

the class RemapValueShaderBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    GraphBoxImpl result = createGraphBox(id);
    addConfigurationInputsAndOutputs(result);
    final CurveWidget curveWidget = new CurveWidget(skin);
    if (data != null) {
        JsonValue points = data.get("points");
        for (String point : points.asStringArray()) {
            String[] split = point.split(",");
            curveWidget.createPoint(Float.parseFloat(split[0]), Float.parseFloat(split[1]));
        }
    } else {
        curveWidget.createPoint(0, 0);
    }
    curveWidget.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            curveWidget.fire(new GraphChangedEvent(false, true));
        }
    });
    curveWidget.setSize(300, 200);
    result.addGraphBoxPart(new GraphBoxPartImpl(curveWidget, new GraphBoxPartImpl.Callback() {

        @Override
        public void serialize(JsonValue object) {
            Array<Vector2> points = curveWidget.getPoints();
            JsonValue pointsValue = new JsonValue(JsonValue.ValueType.array);
            for (Vector2 point : points) {
                pointsValue.addChild(new JsonValue(SimpleNumberFormatter.format(point.x) + "," + SimpleNumberFormatter.format(point.y)));
            }
            object.addChild("points", pointsValue);
        }
    }));
    final VisSelectBox<ClampMethod> clampMethodSelectBox = new VisSelectBox<ClampMethod>();
    clampMethodSelectBox.setItems(ClampMethod.values());
    if (data != null)
        clampMethodSelectBox.setSelected(ClampMethod.valueOf(data.getString("clamp", "Normal")));
    clampMethodSelectBox.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            clampMethodSelectBox.fire(new GraphChangedEvent(false, true));
        }
    });
    VisTable clampActor = new VisTable();
    clampActor.add("Clamp method:").row();
    clampActor.add(clampMethodSelectBox).growX();
    result.addGraphBoxPart(new GraphBoxPartImpl(clampActor, new GraphBoxPartImpl.Callback() {

        @Override
        public void serialize(JsonValue object) {
            object.addChild("clamp", new JsonValue(clampMethodSelectBox.getSelected().name()));
        }
    }));
    return result;
}
Also used : CurveWidget(com.talosvfx.talos.editor.widgets.CurveWidget) GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) GraphChangedEvent(com.gempukku.libgdx.graph.ui.graph.GraphChangedEvent) JsonValue(com.badlogic.gdx.utils.JsonValue) GraphBoxPartImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxPartImpl) VisSelectBox(com.kotcrab.vis.ui.widget.VisSelectBox) VisTable(com.kotcrab.vis.ui.widget.VisTable) Vector2(com.badlogic.gdx.math.Vector2) ClampMethod(com.gempukku.libgdx.graph.shader.ClampMethod) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)

Aggregations

GraphBoxImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl)33 StringBoxPart (com.gempukku.libgdx.graph.ui.part.StringBoxPart)10 JsonValue (com.badlogic.gdx.utils.JsonValue)7 GraphChangedEvent (com.gempukku.libgdx.graph.ui.graph.GraphChangedEvent)6 Graph (com.gempukku.libgdx.graph.data.Graph)4 GraphConnection (com.gempukku.libgdx.graph.data.GraphConnection)4 GraphNode (com.gempukku.libgdx.graph.data.GraphNode)4 GraphProperty (com.gempukku.libgdx.graph.data.GraphProperty)4 IndexBoxPart (com.gempukku.libgdx.graph.ui.part.IndexBoxPart)4 SelectBoxPart (com.gempukku.libgdx.graph.ui.part.SelectBoxPart)4 PropertyNodeConfiguration (com.gempukku.libgdx.graph.config.PropertyNodeConfiguration)3 GraphBoxPartImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxPartImpl)3 CheckboxBoxPart (com.gempukku.libgdx.graph.ui.part.CheckboxBoxPart)3 EnumSelectBoxPart (com.gempukku.libgdx.graph.ui.part.EnumSelectBoxPart)3 ValueGraphNodeOutput (com.gempukku.libgdx.graph.ui.producer.ValueGraphNodeOutput)3 VisTable (com.kotcrab.vis.ui.widget.VisTable)3 Actor (com.badlogic.gdx.scenes.scene2d.Actor)2 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)2 RenderOrder (com.gempukku.libgdx.graph.pipeline.RenderOrder)2 ClampMethod (com.gempukku.libgdx.graph.shader.ClampMethod)2