Jump to content

gui lifetime


Recommended Posts

Posted

hi, i need to use 2 windows for login/register when a player connect, i declared and initialized the 2 windows and their component in the file chunk as local variable, but when the player will login i don't need them anymore so how to destroy them??

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

Posted

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

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

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