I need help getting an imageFont to format correctly;
https://love2d.org/wiki/ImageFontFormat.
The second line shows how Love would render the font after a love.graphics.print('ABCDE')
The last line is how I'd like the font to be rendered.
How would I go about doing this, or is it even possible without some ridiculous workaround?
The first line is how you'd organize your font so it can be read by Love, from what I understand of Need help formatting imageFonts
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Need help formatting imageFonts
It is, indeed, currently impossible to have a spacing of 0 with ImageFonts, I remember there being a ticket on the tracker, but I couldn't find it in the minute of searching I just did.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Need help formatting imageFonts
Correction, in order to make it look like the last (Which is something I also want to be able to do) it would need a spacing of -1.bartbes wrote:It is, indeed, currently impossible to have a spacing of 0 with ImageFonts, I remember there being a ticket on the tracker, but I couldn't find it in the minute of searching I just did.
Re: Need help formatting imageFonts
This might help:
It needs tweaking to handle newlines and such.
Code: Select all
local font = love.graphics.newFont(...)
local offset = 1
function draw_text(x, y, str)
for c in str:gmatch('.') do
love.graphics.print(c, x, y)
x = x + font:getWidth(c) - offset
end
end
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot] and 7 guests