Jump to content

Example of drag and drop UI like the Sub Assemblies?


Recommended Posts

Hey everyone,

Can anyone point me to any source examples of how a plugin might implement a drag and drop UI? Specifically I want to be able to take a part in the VAB and drop it onto a UI element and do something with it. Similar to how the Sub Assemblies thing works.

Link to comment
Share on other sites

Hey everyone,

Can anyone point me to any source examples of how a plugin might implement a drag and drop UI? Specifically I want to be able to take a part in the VAB and drop it onto a UI element and do something with it. Similar to how the Sub Assemblies thing works.

I use that system for the futur version of the welding tool:

Enable the Drag and drop box if the editor have a part selected


GUI.enabled = null != EditorLogic.SelectedPart;
if (GUI.Button(new Rect(x, y, w, h), "drag here",_skinWindow.box))
{
Func();
}
GUI.enabled = true;

Inside your Func(), use the EditorLogic.SelectedPart or a copy of it.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...