Jump to content

Making a GUI?


Recommended Posts

Such a small question :) depending on your mod you would use a plugin or the part menus. I'm not well versed on the part menus stuff, but for a plugin you will need to write a dll that KSP loads and draws the "window" by code lines. I just posted some similar info here on another post for the plugin stuff. Hope it helps - http://forum.kerbalspaceprogram.com/threads/65230-KSP-Coder-Needed%21?p=895228&viewfull=1#post895228

Link to comment
Share on other sites

It's quite possible that you don't need a GUI, and can use boolean tweakables instead. Just add something like this to your PartModule:


[KSPField(guiName = "Sun Tracking", isPersistant = true, guiActiveEditor = true, guiActive = true)]
[UI_Toggle(disabledText = "Disabled", enabledText = "Enabled")]
public bool SunTracking;

If you actually need a GUI, start with looking at how other mods add GUIs.

Here is the documentation and guide about GUI in Unity (keep in mind that it's not KSP-specific)

http://docs.unity3d.com/Documentation/ScriptReference/GUI.html

http://docs.unity3d.com/Documentation/ScriptReference/GUILayout.html

http://docs.unity3d.com/Documentation/Components/GUIScriptingGuide.html

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...