Search in sources :

Example 1 with TransformGizmo

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());
                }
            }
        }
    }
}
Also used : TransformGizmo(com.talosvfx.talos.editor.addons.scene.widgets.gizmos.TransformGizmo) Gizmo(com.talosvfx.talos.editor.addons.scene.widgets.gizmos.Gizmo) Vector2(com.badlogic.gdx.math.Vector2) TransformGizmo(com.talosvfx.talos.editor.addons.scene.widgets.gizmos.TransformGizmo)

Aggregations

Vector2 (com.badlogic.gdx.math.Vector2)1 Gizmo (com.talosvfx.talos.editor.addons.scene.widgets.gizmos.Gizmo)1 TransformGizmo (com.talosvfx.talos.editor.addons.scene.widgets.gizmos.TransformGizmo)1