use of com.talosvfx.talos.editor.addons.scene.widgets.gizmos.TransformGizmo in project talos by rockbite.
the class SceneEditorWorkspace method selectByRect.
private void selectByRect(Rectangle rectangle) {
if (!Gdx.input.isKeyPressed(Input.Keys.SHIFT_LEFT)) {
clearSelection();
}
for (int i = 0; i < gizmoList.size; i++) {
Gizmo gizmo = gizmoList.get(i);
if (gizmo instanceof TransformGizmo) {
TransformGizmo transformGizmo = (TransformGizmo) gizmo;
Vector2 worldPos = transformGizmo.getWorldPos();
Vector2 local = getLocalFromWorld(worldPos.x, worldPos.y);
if (rectangle.contains(local)) {
if (Gdx.input.isKeyPressed(Input.Keys.SHIFT_LEFT)) {
addToSelection(gizmo.getGameObject());
} else {
addToSelection(gizmo.getGameObject());
}
}
}
}
}
Aggregations