[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] I nedd speed



Gabriele Farina wrote:
Tnx a lot I already have a "dirty" flag. Tnx a lot for the other things...
if you're just using standardish button controls it shouldn't be hard to get the rendering speed up to speed. if you find yourself needing to redraw the same control many times, you could render the widget to an offscreen surface, then use that as a cache each time you need to draw the control. but with good 'dirty' control this is not always such a big issue.

for most gui stuff, rendering is the only real bottleneck. outside that you can do all the widget traversal and message passing you want and not notice any effect on speed.

Another question:
To manageing events like rollover, rollour, etc  I test if the mouse is in
or not in the widget...but I see that if I create more than one window, the
events will be managed also for the widgets hidden by other windows
an easy way to handle this is to render the widgets in reverse order. (or you could pass events to widgets in reverse order). if you are just drawing a list of widgets, the ones at the end of the list are drawn "on top" of everything else. so reversing one of these will make them both appear to sync up better.