# Drag and drop in the editor improvements

**URL:** <https://forum.castle-engine.io/t/drag-and-drop-in-the-editor-improvements/626>\
**Category:** News\
**Created:** [August 7, 2022, 12:22am UTC](https://forum.castle-engine.io/t/drag-and-drop-in-the-editor-improvements/626 "2022-08-07T00:22:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [August 7, 2022, 12:22am UTC](https://forum.castle-engine.io/t/drag-and-drop-in-the-editor-improvements/626/1 "2022-08-07T00:22:14Z")

</div>

| [![Drag and drop fun in CGE editor](https://forum.castle-engine.io/uploads/default/original/1X/b94cd381e1b2abfe7e357e4ec222fa97a7ee8bba.png)](https://i0.wp.com/castle-engine.io/wp/wp-content/uploads/2022/08/Zrzut-ekranu-z-2022-08-07-02-01-01.png?ssl=1 "Drag and drop fun in CGE editor") |

A few improvements to the drag-and-drop experience in our editor:

1. You can drag-and-drop from _“Files”_ to _“Hierarchy”_ panel. This will add a child to the currently selected item in the tree view.

2. You can drag-and-drop images from _“Files”_ to the central design area even when you’re not over a viewport. From such image, we will create `TCastleImageControl`. You can also drag-and-drop with `Shift` pressed to force creating a `TCastleImageControl` (instead of the default `TCastleImageTransform`) even when dragging over a viewport.

3. You can drag-and-drop also `.castle-user-interface` files (will create a `TCastleDesign` that references them) or `.castle-transform` files (will create `TCastleTransformDesign` that references them). If you want to test it out, see e.g. [examples/advanced\_editor/advanced\_loading\_designs](https://github.com/castle-engine/castle-engine/tree/master/examples/advanced_editor/advanced_loading_designs) project.

4. I also reported [drag-and-drop bug with cursor on Lazarus GTK2 widgetset](https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39844) that affects us.

In effect (summing up previous and new features):

You can drag-and-drop various files from “Files” to “Hierarchy” or central design area.

- You can drag-and-drop scene files (like glTF or X3D files) on the viewport to create `TCastleScene`.

- You can drag-and-drop sound files (like WAV or OggVorbis) on the viewport to create `TCastleTransform` with `TCastleSoundSource`.

- You can drag-and-drop images (like PNG or JPG) on the viewport to create `TCastleImageTransform` or on anything else (or hold Shift) to create `TCastleImageControl`.

- You can drag-and-drop UI designs (.castle-user-interface) to create `TCastleDesign`.

- You can drag-and-drop transform designs (.castle-transform) to create `TCastleTransformDesign`.

Enjoy, happy dragging and dropping 🙂
