Jump to content

Recommended Posts

Posted

Hi, I wanted to remove a button and a string from an exisiting gui. "event.buttonList.remove(2);" worked perfectly fine to remove the button but is there a similar code to remove a string? :)

And also, is there a way to change the state of a button? For instance when I click on "Create World" it's usually set to "Survivial" and I would like it to be set to "Creative" without having to click on it :)

Posted
  On 1/4/2018 at 9:44 PM, diesieben07 said:

No. Text drawing is usually hardcoded in the GUIs drawScreen method.

 

There is no uniform way. You need to check what the button does when clicked on and then perform a similar action when the GUI is opened.

Expand  

Oh okay. And is there a way to "hide" buttons instead of removing them with "event.buttonList.remove(2);"? That one seems to crash my game :L

Posted

If you can get the GuiButton variable

possibly event.buttonList.get(number) or something like that

You can set the visible variable to true/false

Posted
  On 1/4/2018 at 11:32 PM, hiotewdew said:

If you can get the GuiButton variable

possibly event.buttonList.get(number) or something like that

You can set the visible variable to true/false

Expand  

But where am I supposed to get that variable? :L

Posted
  On 1/4/2018 at 11:36 PM, weeeee said:

But where am I supposed to get that variable? :L

Expand  
  Quote

possibly event.buttonList.get(number) or something like that

Expand  
 

 

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.