- Home /
Are dockable windows possible in-game.
Is it possible, with the native gui, or any of the gui toolkits/system, to create a gui window that is dockable within the unity game engine(not the editor)? For example, dragging a window to the side of the screen and having it dock there.
This is kind of a second question, but if the first is possible, is it also possible to pull out a window from a tab(like pulling a tab out of chrome or firefox to make a new window)?
Answer by Bunny83 · Jan 06, 2014 at 11:11 AM
The answer is: Yes, it is possible with the native gui, or any of the gui toolkits/systems.
However you have to code it yourself. Don't expect someone to post a ready-to-use solution here. Such a system requires a lot fiddling and has to be adapded to your exact needs.
Also "docking / dockable" is a wide term and there are tons of different behaviors out there.
Ok. Thanks for the answer. I will still hold out hope that some kind and generous soul posts some example code(or a link to some).
Just take a look at NGUI or any other GUI solution, they come with a lot of examples, and code, where necessary.
I think that ultimately I would want the ui to work similarly to the way unity editor works, customizable, with different layouts, windows that can be resized, windows that can be added or closed or maximized, and windows that can be docked with tabs, or dragged out to float freely. It would be nice if unity facilitated this more, but if it has to be remade, then that's just the way it is.
Answer by Geo.Ego · Feb 11, 2014 at 03:25 PM
If you want to get started with a window you can drag around, I made a blog post outlining how to do that here.
Basically, you add a Collider to the element you want the user to click to drag, add the UIDragObject script on to that object, and drag the object you want to move around to the UIDragObject's "Target" parameter.
More complex behaviors and animations can be triggered with Colliders and Triggers, but as Bunny83 said, no-one's going to write them for you.
Your answer
![](https://koobas.hobune.stream/wayback/20220613125655im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Set the parent of an external application window to a Unity UI element (specifically, Panel) 1 Answer
how will i get every time values in table window? 0 Answers
Add EditorUI elements when a button is pressed 0 Answers
Center GUI wondow or box in windowed mode 3 Answers
how to get Gui in OnGUI function to resize with the window? 1 Answer