Jump to content

destroying alot "GUIs" causes lag for 1sec


Fist

Recommended Posts

Each time someone re-opens that window i destroy old guis with destroyElement() and create them for new to refresh 'cause im using staticImages and i need them update each time they re-open that window but if they have too much staticImages then it causes lag for 1 second, is there anyway to fix it?

p.s guiStaticImageLoadImage is not the way i can do that, it won't work for me.

Edited by Fist
Link to comment
2 hours ago, Tails said:

A small example code would be nice. I don't see any way why guiStaticImageLoadImage won't work.

Instead of destroying and recreating the gui try toggle their visiblity:


guiSetVisible(element, not guiGetVisible(element))

 

as i said before, i'm doing that 'cause i need to refresh them each time player reopens window. But the problem with that is that it makes client lag a bit if there's too many gui elements.

Edited by Fist
Link to comment
2 minutes ago, Mr.Loki said:

Reduce the sizes of the images.

If it's too large it will take the client a while to load each image.

There's no rant to have images that are 2000x2000 when they are only 200x200 in-game.

images are small size, around 150x70 some even smaller but i have them like 50 loading at same time

Link to comment
1 hour ago, NeXuS™ said:

Try loading all of them in when the client loads in, and just set their visibility.

yep that's what i thought at start, but then i had to remake all that refreshing system for new and i did it but it was worth it and now all works so perfect without any lag. (problem solved)

 

btw by any chance do you know why scrollpane scrollbars reset to 0 when you scroll them up and almost same thing when you scroll down?

Edited by Fist
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...