Quote:
Originally Posted by wilhel1812 will it become anti aliased? |
LOL, I'm just figuring this stuff out as I go along, and I have no idea what you mean by that
Another function I just figured out is getTextSize, used as:
Code:
myfont:getTextSize("text")["width"] --returns what the width of the text would be if
printed with the named font
or
myfont:getTextSize(text)["height"] --returns the height
as an example of its use, here is a bit of code that will use a ttf and print text centered on the screen
Code:
myfont = Font.load("fontname.ttf")
myfont:setPixelSizes(0, 20)
function printCentered(font, y, text, color)
screen:fontPrint(font, 240 - ((font:getTextSize(text)["width"])/2), y, text, color)
end
screen:clear()
printCentered(myfont, 100, "Centered Text", blue)
screen.flip()
while true do
pad = Controls.read()
if pad:start() then break
end
end
Doubleposted Message Below:
hmm..
setCharSize(width, height, Dx, Dy) makes the font size smaller than setPixelSizes(width, height) even if you use the same numbers for width and height. Anyone know why is works out that way?