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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations