Jump to content

UI creation help


jmbon

Recommended Posts

Hello, I am currently working on creating my first mod for KSP and I find myself sort of hung up on UI creation in KSP. 

I followed the example given in 

 but 1) I don't want to tie my UI to a specific part like the author of the above video does, I'd rather tie it to a button click in the game much like Kerbal Alarm Clock does. Once I am able to display it via in game buttonclick events, 2) I'd like a radial gauge widget to appear similar in shape to a compass. Are there any good examples of both of those you could point me to. I've looked through Github at example code but a lot of the code is a mess and almost none of it is commented. All of the tutorials like the one above are close but not quiet what I am looking for. I feel like I need to use Unity to create a UI gameobject and then import that gameobject into KSP but I am unsure if that is the right course and if it is, how to even begin doing that. Thank you in advance for your help. 

Link to comment
Share on other sites

With 1.1 you are better off creating the UI in Unity if it is of custom shape and/or more than just a simple window. This thing is pretty new, but you can try to look at some simple code in latest Beta for Sequencer (check my signature). Look inside SequecerGUI class for a method InitSettingsWindow()

You don't have to tie the UI to a part, you can have a Monobehaviour as your KSPAddon that runs, for example, in Flight mode. You can see the syntax for it in the same file.

Look for Unity docs on Monobehavoir for more details.

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