Page 4 of 7

Re: Goo: Gui and Animation library.

Posted: Thu Nov 04, 2010 9:15 pm
by the_leg
You would create a static text object whose parent is a panel. In your love.load() you would do something like this:

Code: Select all

	local panel = goo.panel:new()
	panel:setPos(100, 100 )
	panel:setSize(200, 200 )
	panel:setTitle( 'I am a panel' )

	local text = goo.text:new(panel )
	text:setPos(0,10) 
	text:setColor2(0, 0, 0)  
	text:setText('This is some\nsample text to print.')
I had to uncomment setColor2() in goo.lua to change the text foreground color. I also had to fiddle with the draw() method of the text object (objects/text.lua), so it prints at 0,0 instead of x,y. I'm not sure if those modifications are correct. Let me know if you find a better way.

Re: Goo: Gui and Animation library.

Posted: Thu Nov 04, 2010 10:50 pm
by adrix89
You can set the color as a style just like it was in text input
The print x,y is good that is 0 as neither is textinput using theme
Is it me or is text kind of left out?

Re: Goo: Gui and Animation library.

Posted: Fri Nov 05, 2010 7:10 am
by the_leg
The text prints fine for me, but I had to play around with getting the text color set. Try using a dark background color for the panel, and see if that makes any difference.

Re: Goo: Gui and Animation library.

Posted: Fri Nov 05, 2010 6:28 pm
by adrix89
You do know that you can set the ext to render in whatever color you like if you modify a bit copying stuff from textinput right?

Re: Goo: Gui and Animation library.

Posted: Fri Nov 05, 2010 7:20 pm
by the_leg
Sure, but then my Goo would be different from your Goo and that would make it harder to exchange Goo ideas/advice. If you've already done some enhancement work on the text object, maybe you can ask the author to include it in the official Goo.

Re: Goo: Gui and Animation library.

Posted: Fri Nov 05, 2010 9:39 pm
by ljdp
Ah Goo. This was a project for one of my other projects then I thought other people might find it useful, slapped some documentation on it and made it public.
Needless to say it got a lil messy and if I had the time i'd rewrite it from scratch.

However, feel free to fork the project on github and make changes and i'll merge it back the original.

Re: Goo: Gui and Animation library.

Posted: Sat Nov 06, 2010 9:26 am
by adrix89
the_leg wrote:Sure, but then my Goo would be different from your Goo and that would make it harder to exchange Goo ideas/advice. If you've already done some enhancement work on the text object, maybe you can ask the author to include it in the official Goo.
Pretty pointless to say now since you have modify plenty to get it to work on 0.7
Besides some things are plain broken,like text ,and multiline
ljdp wrote:Ah Goo. This was a project for one of my other projects then I thought other people might find it useful, slapped some documentation on it and made it public.
Needless to say it got a lil messy and if I had the time I'd rewrite it from scratch.

However, feel free to fork the project on github and make changes and I'll merge it back the original.
Unfortunately I have no idea how to fork things,nor do I want the responsiblity to manage the fork
heres my current changes if someone wants to fork it
What it has extra is fixed text ala textinput
Also multiline is fixed and added a boundary to wrap to start if its bigger then size panel
Added also another test to see how multiline works
Also added a key ignore so as to add extra functions on onKeypress (in the demo kpenter prints text)

Note that some things might be broken,for example I have no idea about scrlog or the progress bar works so its unmodified(although scrlog has one modified line that might fix it or not,if it needs it)

Re: Goo: Gui and Animation library.

Posted: Sat Nov 06, 2010 9:42 am
by Robin
Hey, this looks much better than I expected!

It crashes on the "change theme" thing, because it can't find the dark style.

Also, window dragging is a bit buggy.

Re: Goo: Gui and Animation library.

Posted: Sat Nov 06, 2010 12:33 pm
by adrix89
I seriously have no idea why it can't change the skin
If its a folder it has no problem but if tis a .love it crashes
maybe something broke in 0.7?
Ok not even the original 0.6 in .love form doesn't work
It might be archiving process or a bug in love

Haven't touched the dragging

Re: Goo: Gui and Animation library.

Posted: Sat Nov 06, 2010 3:11 pm
by Robin
adrix89 wrote:I seriously have no idea why it can't change the skin
If its a folder it has no problem but if tis a .love it crashes
maybe something broke in 0.7?
Ok not even the original 0.6 in .love form doesn't work
It might be archiving process or a bug in love
I know why: the folder is named "Dark", while the code refers to "dark". Capitalization matters! Renaming it makes it work in .loves and on Linux/Mac.
adrix89 wrote:Update!
Where?