use of com.talosvfx.talos.editor.widgets.ShapeInputWidget in project talos by rockbite.
the class OffsetModuleWrapper method configureSlots.
@Override
protected void configureSlots() {
addInputSlot("alpha (0 to 1)", InterpolationModule.ALPHA);
lowShape = new ShapeInputWidget(getSkin());
highShape = new ShapeInputWidget(getSkin());
curveWidget = new CurveWidget(getSkin());
curveWidget.setDataProvider(this);
Table midTable = new Table();
equalsButton = new ImageButton(getSkin(), "chain");
equalsButton.setChecked(true);
midTable.add(equalsButton);
contentWrapper.add(lowShape).width(100).pad(5);
contentWrapper.add(midTable).width(30);
contentWrapper.add(highShape).width(100).pad(5);
contentWrapper.row();
contentWrapper.add(curveWidget).width(240).height(100).padTop(0).colspan(3).padBottom(3);
contentWrapper.padTop(15);
addOutputSlot("output", OffsetModule.OUTPUT);
leftWrapper.add(new Table()).expandY();
rightWrapper.add(new Table()).expandY();
if (module != null) {
updateModuleDataFromWidgets();
}
equalsButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
lowShape.getShapePos(pos);
lowShape.getShapeSize(size);
if (equalsButton.isChecked()) {
highShape.setScaleVal(lowShape.getScale());
highShape.setPos(pos);
highShape.setShapeSize(size);
}
}
});
lowShape.setListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
lowShape.getShapePos(pos);
lowShape.getShapeSize(size);
if (equalsButton.isChecked()) {
highShape.setScaleVal(lowShape.getScale());
highShape.setPos(pos);
highShape.setShapeSize(size);
}
updateModuleDataFromWidgets();
}
});
highShape.setListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
highShape.getShapePos(pos);
highShape.getShapeSize(size);
if (equalsButton.isChecked()) {
lowShape.setScaleVal(highShape.getScale());
lowShape.setPos(pos);
lowShape.setShapeSize(size);
}
updateModuleDataFromWidgets();
}
});
}
Aggregations