Search in sources :

Example 1 with TextureSettingsGraphBoxPart

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

the class PropertyShaderGraphBoxProducer method createPipelineGraphBox.

@Override
public GraphBox createPipelineGraphBox(Skin skin, String id, JsonValue data) {
    final String name = data.getString("name");
    final String propertyType = data.getString("type");
    GraphBoxImpl result = new GraphBoxImpl(id, new PropertyNodeConfiguration(name, propertyType)) {

        @Override
        public JsonValue getData() {
            JsonValue result = super.getData();
            if (result == null)
                result = new JsonValue(JsonValue.ValueType.object);
            result.addChild("name", new JsonValue(name));
            result.addChild("type", new JsonValue(propertyType));
            return result;
        }
    };
    result.addOutputGraphPart(new ValueGraphNodeOutput(name, propertyType));
    if (ShaderFieldTypeRegistry.findShaderFieldType(propertyType).isTexture()) {
        TextureSettingsGraphBoxPart textureSettings = new TextureSettingsGraphBoxPart();
        textureSettings.initialize(data);
        result.addGraphBoxPart(textureSettings);
    }
    return result;
}
Also used : GraphBoxImpl(com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl) TextureSettingsGraphBoxPart(com.gempukku.libgdx.graph.ui.graph.property.TextureSettingsGraphBoxPart) PropertyNodeConfiguration(com.gempukku.libgdx.graph.config.PropertyNodeConfiguration) JsonValue(com.badlogic.gdx.utils.JsonValue) ValueGraphNodeOutput(com.gempukku.libgdx.graph.ui.producer.ValueGraphNodeOutput)

Example 2 with TextureSettingsGraphBoxPart

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

the class SceneColorShaderBoxProducer method createPipelineGraphBox.

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

Aggregations

GraphBoxImpl (com.gempukku.libgdx.graph.ui.graph.GraphBoxImpl)2 TextureSettingsGraphBoxPart (com.gempukku.libgdx.graph.ui.graph.property.TextureSettingsGraphBoxPart)2 JsonValue (com.badlogic.gdx.utils.JsonValue)1 PropertyNodeConfiguration (com.gempukku.libgdx.graph.config.PropertyNodeConfiguration)1 ValueGraphNodeOutput (com.gempukku.libgdx.graph.ui.producer.ValueGraphNodeOutput)1