Jump to content

How do I call a function on a button press?


Recommended Posts

I'm trying to follow DMagic's UI tutorial, and I am currently trying to get my head around interfaces - and buttons. I can call any public function with OnClick(), but I'm not sure how to send that event to the KSP assembly.
What I've thought of are setting some variable to a certain value and checking every once in a while through the interface if that variable has changed, and calling a GameEvent which gets picked up by the other assembly (I'm not sure if that's possible). Would either of these methods work, or is there a better way to do this?

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.

 Share

×
×
  • Create New...