Search in sources :

Example 1 with DragPoint

use of com.talosvfx.talos.editor.widgets.ui.DragPoint in project talos by rockbite.

the class TargetModuleWrapper method configureSlots.

@Override
protected void configureSlots() {
    addInputSlot("alpha", TargetModule.ALPHA_INPUT);
    velocityField = addInputSlotWithTextField("velocity: ", TargetModule.VELOCITY);
    Cell fromCell = addInputSlot("from", TargetModule.FROM);
    Cell toCell = addInputSlot("to", TargetModule.TO);
    fromLabel = getLabelFromCell(fromCell);
    toLabel = getLabelFromCell(toCell);
    velocityField.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            float velocity = floatFromText(velocityField);
            module.setDefaultVelocity(velocity);
        }
    });
    dragPointFrom = new DragPoint(0, 0);
    dragPointTo = new DragPoint(0, 0);
    addOutputSlot("time", TargetModule.TIME);
    addOutputSlot("position", TargetModule.POSITION);
    addOutputSlot("velocity", TargetModule.VELOCITY_OUT);
    addOutputSlot("angle", TargetModule.ANGLE);
}
Also used : DragPoint(com.talosvfx.talos.editor.widgets.ui.DragPoint) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener) Cell(com.badlogic.gdx.scenes.scene2d.ui.Cell)

Example 2 with DragPoint

use of com.talosvfx.talos.editor.widgets.ui.DragPoint in project talos by rockbite.

the class FromToModuleWrapper method configureSlots.

@Override
protected void configureSlots() {
    Cell fromCell = addInputSlot("from", FromToModule.FROM);
    Cell toCell = addInputSlot("to", FromToModule.TO);
    fromLabel = getLabelFromCell(fromCell);
    toLabel = getLabelFromCell(toCell);
    addOutputSlot("rotation", FromToModule.ROTATION);
    addOutputSlot("size", FromToModule.LENGTH);
    addOutputSlot("position", FromToModule.POSITION);
    dragFrom = new DragPoint(-1, 0);
    dragTo = new DragPoint(1, 0);
    if (module != null) {
        module.setDefaults(dragFrom.position, dragTo.position);
    }
}
Also used : DragPoint(com.talosvfx.talos.editor.widgets.ui.DragPoint) Cell(com.badlogic.gdx.scenes.scene2d.ui.Cell)

Example 3 with DragPoint

use of com.talosvfx.talos.editor.widgets.ui.DragPoint in project talos by rockbite.

the class GlobalScopeModuleWrapper method configureSlots.

@Override
protected void configureSlots() {
    dragPoint = new DragPoint(0, 0);
    Array<String> array = new Array<>();
    for (int i = 0; i < 10; i++) {
        array.add(i + "");
    }
    selectBox = addSelectBox(array);
    addOutputSlot("output", GlobalScopeModule.OUTPUT);
}
Also used : Array(com.badlogic.gdx.utils.Array) DragPoint(com.talosvfx.talos.editor.widgets.ui.DragPoint) DragPoint(com.talosvfx.talos.editor.widgets.ui.DragPoint)

Example 4 with DragPoint

use of com.talosvfx.talos.editor.widgets.ui.DragPoint in project talos by rockbite.

the class Vector2ModuleWrapper method configureSlots.

@Override
protected void configureSlots() {
    xField = addInputSlotWithTextField("X: ", 0);
    yField = addInputSlotWithTextField("Y: ", 1);
    dragPoint = new DragPoint(0, 0);
    xField.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            float x = floatFromText(xField);
            module.setX(x);
            dragPoint.set(x, dragPoint.position.y);
        }
    });
    yField.addListener(new ChangeListener() {

        @Override
        public void changed(ChangeEvent event, Actor actor) {
            float y = floatFromText(yField);
            module.setY(y);
            dragPoint.set(dragPoint.position.x, y);
        }
    });
    addOutputSlot("position", 0);
}
Also used : DragPoint(com.talosvfx.talos.editor.widgets.ui.DragPoint) Actor(com.badlogic.gdx.scenes.scene2d.Actor) ChangeListener(com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)

Aggregations

DragPoint (com.talosvfx.talos.editor.widgets.ui.DragPoint)4 Actor (com.badlogic.gdx.scenes.scene2d.Actor)2 Cell (com.badlogic.gdx.scenes.scene2d.ui.Cell)2 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)2 Array (com.badlogic.gdx.utils.Array)1