Are there any tips for making ifsoGUI run faster? I am working on a game, and without ifsoGUI running it is currently about 400 fps. As soon as I put an ifsoGUI panel on my screen with three buttons and two progress bars, it drops to about 230 fps. In the grand scheme of things, this probably doesn't sound that bad, but I have a lot more buttons that I want to add. If I go up to 9 buttons it gets down to 160-ish fps. I haven't tested past that point
It seems like the bulk of the fps hit is coming from the DrawBox routine. Digging through what it's doing in there, it seems that it's doing a lot of calculations to determine how to stretch/tile the images that are used to make up the controls. I'm considering making a "simple button" type where I pre-render the button as an image of the size I want and skip DrawBox altogether, but am hoping there's a better way.
The GUI does a lot of work to allow the gadgets to be resizeable.
You could easily make a simple button gadgets that does not have any resizing capabilities. You could also use the ImageButton gadget and SetShowButton(False) so it does not draw the button and set your button graphic as the image to be drawn. That should help.
You also have to remember that the hit to performance is not linear. It takes more and more time to reduce each successive frame of performance.
It would also be possible to make a set of gadgets that are not resizeable. Each could be drawn in just one DrawImage rather than a series of them. But your graphics would have to be drawn to size, and you could not resize them on the fly, which kind of defeats the purpose of a GUI. If you had to draw each panel and buttons graphics to size, then you could just easily draw them to the screen and a GUI system would not really be necessary as it would be very basic.