View Single Post
  #7 (permalink)  
Old 02-25-2007, 07:36 PM
Merick's Avatar
Merick Merick is offline
Member
My Mood:
 
Join Date: Feb 2007
Posts: 45
Points: 73.58
Donate
Quote:
Originally Posted by wilhel1812 View Post
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?

Last edited by Merick : 02-25-2007 at 07:36 PM. Reason: PSP3D.com Doublepost Preventer
Reply With Quote