Jump to content

gui lifetime


Recommended Posts

guiSetVisible just hide the gui from the player but it still allocated on the client memory, i think destroyElement is the solution

destroyElement is not the solution. If you destroy the GUI you'll need to create it again. It may give you some errors if you destroy it and u use the variable.

Solution is guiSetVisible. You can hide and un-hide it whenever u want and no need to create it again.

Link to comment
i know i've made a init_gui and destroy_gui function, normally when the player connect to the server i will show him the login gui, if he login succefully i will not need to show the logIn dialog anymore so i detroy it using destroyElement

If you are triggering server to client for gui remember to trigger for that player only or it may destroy for others who din't login.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...