Fist Posted March 22, 2017 Share Posted March 22, 2017 (edited) 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 March 22, 2017 by Fist Link to comment
Tails Posted March 22, 2017 Share Posted March 22, 2017 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)) Link to comment
Fist Posted March 22, 2017 Author Share Posted March 22, 2017 (edited) 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 March 22, 2017 by Fist Link to comment
Fist Posted March 22, 2017 Author Share Posted March 22, 2017 just found out that it actually (destroyElement) didn't make any lag but the images that are being loaded when they are too much. Is there a way to avoid lag when making quite alot staticimages? Link to comment
Mr.Loki Posted March 22, 2017 Share Posted March 22, 2017 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. Link to comment
Fist Posted March 22, 2017 Author Share Posted March 22, 2017 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
NeXuS™ Posted March 22, 2017 Share Posted March 22, 2017 Try loading all of them in when the client loads in, and just set their visibility. Link to comment
Fist Posted March 22, 2017 Author Share Posted March 22, 2017 (edited) 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 March 22, 2017 by Fist Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now