LoveUI for Love 0.5.0

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

I've also detected some bugs with reloadData, fixing it atm.
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.
Umm... what about mousepressed function: mousepressedGUI ?? and all the other input ones.

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.
Attachments
LoveUI(unstable).love
(86.48 KiB) Downloaded 146 times
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

Re: LoveUI... has button, Textfield, scrollVIew

Post by Sparx »

A bit too technical for me, but performance after reload is better.
But still performance with a "large" table is poor.
I like to use the reload everytime the data of a single new server is obtained, so the user doesn't have to wait for all servers to be loaded...
I had some 30 testservers to be obtained and after one single update performance was not acceptable.

Thanks for the quick update, but I hope work is still going on on the performance topic.

Great Work!
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

After working for a couple of hours with the insides on my library; I have two pieces of news to announce. One good one bad.
Bad news: I have not been able to reduce the growth rate in time needed to render the rows of the table view. More rows = slower. :(
Good news: with some refactoring of my fake matrix and the graphics environment code I was able to increase FPS by 100% in the demo, from 25 frames to 50. It'll take quadrupling of the rows in the tableView before the FPS gets dropped back to 25 again.
Attachments
LoveUI(unstable).love
(86.5 KiB) Downloaded 137 times
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

Re: LoveUI... has button, Textfield, scrollVIew

Post by Sparx »

Sorry this was not too good, demo works but in my own project.. look at the file every second frame it looks something like this every other frame its allright.

I start the game by hiding all the menu and reseting the draw update and load functions. Ingame gfx are completly fucked, while 90% of the menu stays..
Attachments
error.png
error.png (228.94 KiB) Viewed 4483 times
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, scrollVIew

Post by appleide »

Can you give me a copy of your source code so I can test it? I suspect its GraphicsEnvironment.lua; I basically took an axe and tried to axe as much code as possible in order to boost speed. Evidently I only tested it with the demo...

Here's one with only a 50% boost in FPS. *cross my fingers*

EDIT: I'm really really curious how my library can manage such a feat; screwing with so many pixels....... The best I've got it to do was change fonts, line widths, mess with scissors, coordinates, but I've never seen anything like this. That's why I want to take a look at your code.
Attachments
LoveUI(unstable).love
(86.49 KiB) Downloaded 154 times
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

Re: LoveUI... has button, Textfield, scrollVIew

Post by Sparx »

This one is good same speed as with the problems but without them =)
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

Re: LoveUI... has button, Textfield, tableView

Post by Sparx »

Sometimes when i run my project including LoveUI and I try typing into a textfield it puts 2 or 3 characters of the one im typing into it(deleting to).
The more fps I have the more often this problem occurs.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, tableView

Post by appleide »

Hmm... that's a problem. Here's a short term get around, but you'll likely remove key-repeats too.

Code: Select all

aContext.keyRepeatSpeed=3000
The default value is 300 ms. Try raise it to 3 seconds and keys shouldn't repeat like you described (It'll only repeat after holding the key for 3 seconds, slowly accelerating from that base amount.).

I'm suspecting this could be a timer and input problem. Maybe also to do with zeroes. This will definitely be fixed when 0.6.0 comes out, because that version comes with key repeats, so I don't need to implement my own anymore.
User avatar
Sparx
Party member
Posts: 125
Joined: Thu Apr 02, 2009 9:54 am
Location: Aachen, Germany

Re: LoveUI... has button, Textfield, tableView

Post by Sparx »

Found the problem:
I couldn't out "aContext:plugin();" out of the load function of my menu somehow... everytime it was loaded it put more chars...
Now I loaded the load draw update keypressed functions BEFORE the statemanager loads the states... very important
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: LoveUI... has button, Textfield, tableView

Post by appleide »

I see....
btw. the plug in function is only supposed to be used as a quick solution for small prototypes. If you're gonna have states I recommend manually calling the relevant functions in load draw update mousepressed, etc.
Post Reply

Who is online

Users browsing this forum: No registered users and 72 guests