Page 6 of 10

Re: a Rich Text library for LÖVE

Posted: Mon Nov 08, 2010 9:57 am
by Mud
Robin wrote:Oh, I thought you enabled debug mode, which draws those rectangles so you can check whether everything's aligned OK.
And so I did. >.>
Robin wrote:Are you on windows? I think for that you need to wait until rude makes another build, or ask a friendly lover on windows who just happened to have compiled it themselves recently.
How are you guys building it? Do you have a libraries package somewhere, or are you downloading them from their respective sources?

Re: a Rich Text library for LÖVE

Posted: Mon Nov 08, 2010 12:59 pm
by TechnoCat
Mud wrote:How are you guys building it? Do you have a libraries package somewhere, or are you downloading them from their respective sources?
http://web.ics.purdue.edu/~dcfritz/file ... in-sdk.zip
That should help you get started.

sorry to off-topic like that.

Re: a Rich Text library for LÖVE

Posted: Mon Nov 08, 2010 11:25 pm
by luminosity
Robin wrote:
luminosity wrote:I've noticed rendering text to a buffer seems to make it extremely ugly and hard to read. That seems to be love wide rather than specific to this library though. I don't suppose anyone knows what's going on there? I can attach screenshots if someone wants.
Odd, I have never seen that effect. Screenshots would be useful, yes. :)
Rendering text directly to screen using love.graphics.printf:
no-framebuffers.png
no-framebuffers.png (2.99 KiB) Viewed 2441 times
Rendering with 1 framebuffer, used by rich text:
1-framebuffer.png
1-framebuffer.png (8.37 KiB) Viewed 2441 times
Rendering several rich text messages into an image using a framebuffer in my draw method:
2-framebuffers.png
2-framebuffers.png (7.15 KiB) Viewed 2441 times

Re: a Rich Text library for LÖVE

Posted: Tue Nov 09, 2010 4:46 pm
by Robin
Hm. The problem seems to be that RichText doesn't round off any positions. Luckily, that's fixable.
luminosity wrote:Rendering several rich text messages into an image using a framebuffer in my draw method:
Wait, what?

Re: a Rich Text library for LÖVE

Posted: Wed Nov 10, 2010 1:02 am
by luminosity
Robin wrote:Hm. The problem seems to be that RichText doesn't round off any positions. Luckily, that's fixable.
Ah. I didn't think of that when I first ran into these problems. Though... why would not rounding be a problem when rendering text to an image but not when rendering directly to screen? I'd have thought love would treat both the same way.
Robin wrote:
luminosity wrote:Rendering several rich text messages into an image using a framebuffer in my draw method:
Wait, what?
My previous code for the combat log rendered strings to an image so I could use a quad to choose what to display. When I substitued rich text in I put it in place of the printfs, so it now renders rich text's framebuffers inside my own framebuffer.

Re: a Rich Text library for LÖVE

Posted: Wed Nov 10, 2010 5:39 pm
by Robin
luminosity wrote:Ah. I didn't think of that when I first ran into these problems. Though... why would not rounding be a problem when rendering text to an image but not when rendering directly to screen? I'd have thought love would treat both the same way.
I have no idea. I do have, however, committed what I hope to be a fix to your problem. Will push it to GitHub soon. [EDIT: pushed. You may commence the cheering.]
luminosity wrote:so it now renders rich text's framebuffers inside my own framebuffer.
Someone please post the obligatory Xzibit image macro. :P

Re: a Rich Text library for LÖVE

Posted: Thu Nov 11, 2010 12:08 am
by luminosity
Robin wrote:[EDIT: pushed. You may commence the cheering.]
Just updated to it. I get an error running it out of the box, where it sets self.height = y. "Attempt to index global self, a nil value." Having fixed that, unfortunately your change doesn't seem to have stopped the weird rendering for a framebuffer. I'm a bit stumped trying to figure out what could be causing it.
different-framebuffers.png
different-framebuffers.png (4.26 KiB) Viewed 2383 times
The thing that stumps me is that the End Turn text here is rendered using a framebuffer and the text in it looks fine. The rich text in the log just above it isn't however. But it's not just the rich text, if I draw my own framebuffer there and put some text in it it also looks odd like the rich text. I've checked that the left, and top values given to draw are rounded, just to be sure, and they are.

In any case, since I have one framebuffer working and another not, there has to be some difference that accounts for it. I'll play around and try to figure it out.

Re: a Rich Text library for LÖVE

Posted: Thu Nov 11, 2010 6:45 am
by Robin
Whoops. I think the latest commit fixes the error.
luminosity wrote:In any case, since I have one framebuffer working and another not, there has to be some difference that accounts for it. I'll play around and try to figure it out.
Sure. I have no idea what would be different.

Re: a Rich Text library for LÖVE

Posted: Fri Dec 03, 2010 11:07 pm
by Robin
All right, more updates! Experimental ones.

This is an attempt to fix the horrible mess that was word-wrapping. However, it doesn't work exactly right yet. And you can help out! Test it out, or check the source code for mistakes.

Re: a Rich Text library for LÖVE

Posted: Mon Jan 24, 2011 5:50 am
by luminosity
Just upgraded, and I had two small problems.

1. If colormode is set to replace by the love app, text won't be drawn with colours. I can see the justification for going with the user's choice, but when asking for a colour, I suspect people want a colour. In any case, I just chucked the colour modes I wanted in to the library and it all works for me, so no problem if you disagree.

2. Text lines are rendered very close, after hitting a new line, and seem to ignore any attempt to set line height on the font. I'd like to space my text out a little more, any chance that there'd be an easy way to specify this?

Thanks!