I'm finding that printing multiple lines using love.graphics.print slows my framerate down significantly. Is this a known thing, or could I be doing something wrong?
[Edit]: Turns out I was setting a new font each time. Woops.
Instead, is there a way to dynamically set a font's size?
love.graphics.print very expensive?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: love.graphics.print very expensive?
The answer seems to be 'No'. And scaling is not the way to go with fonts. What are you goals? Animation?
Re: love.graphics.print very expensive?
It's not really heavy, i hope you're using \n instead of making one draw per line, and as said before it may be the font .. (but i don't really think)
Edit : Eh yeah, solved, i'm late.
Edit : Eh yeah, solved, i'm late.
Re: love.graphics.print very expensive?
Dio Mio!!! No, you're not late at all. I myself forgot to use "\n". Not critical at the moment, but it was silly.Lapin wrote:i'm late.
Thanks for the reminder.
Re: love.graphics.print very expensive?
Yep, love.graphics.print IS VERY expensive! Draw to canvas and only use when updating.
Re: love.graphics.print very expensive?
Not in his case (question already changed):SiENcE wrote:Yep, love.graphics.print IS VERY expensive! Draw to canvas and only use when updating.
Canvases are good with static (or semi-dynamic at least) graphics only. For dynamically changing graphics they're slow it down. I'm already tested this with my vector shapes experiments.Goober wrote:[Edit]: Turns out I was setting a new font each time. Woops.
Instead, is there a way to dynamically set a font's size?
I've an idea for high-quality dynamic fonts & cool effects (like here: http://www.imagemagick.org/Usage/fonts/), which needs testing: Draw all letters in Inkscape, convert them to paths, or beziers, export, then use in LÖVE as a polygon mesh. Maybe even collect kerning info somehow. But what of hinting, hm...
Another opportunity would be to port nanovg's ttf part and load contours directly from font file.
Easily achievable with ImageMagick, but slow. Should be implemented using polygon meshes + shaders:
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot], Google [Bot], Semrush [Bot] and 4 guests