Umm... what about mousepressed function: mousepressedGUI ?? and all the other input ones.Sparx wrote:just as far as I need it for my projects =)
I figured out how to use the tableview and buttons, till jet thats all i need.
But i think there might be more elegant ways to use a GUI:
in the draw function should be just: drawGUI
and in the update: updategui(dt)
and for the rest all the elements should be set by functions.. which seems more difficult in LoveUI... I'm still using it since it's quite functional and looks nice.
EDIT: My demo runs at 25fps, and I've found the source of all performance problems.
There are two, actually. One involving "storeGraphicsEnvironment", and the other "pushMatrix". They involve ALOT of function calls for EACH and EVERY widget, EVERY SINGLE FRAME. the graphics environment makes sure that, e.g, line widths, colors, fonts, etc, get reset at the end of drawing for each widget (to what it was, before the widget began drawing). I could go around this by having each widget cleaning before/after itself, instead.
The pushMatrix/popMatrix/translate, allows users to place views based on coordinates of its superviews. I believe this allows too much convenience to be scrapped. That's why it wont be fixed in the current love version. Either this gets implemented using OpenGL in the coming love versions, OR I'll do this using the coming love.native library.
By including these two calls I reduced my FPS from hundreds down to couple of dozens. That's not fun.
p.s reloadData isn't supposed to be called every frame.
Here's an update that fixed some bugs reloadData had; It didn't reload the scrollers properly.