Submit Your Own Code

PSP Lua CodeBase : Centered Text with with your own font (.TTF)

Description:
This function allows you to print your own font and to center your
text. Thanks to Access_Denied for the center text function, and EminentJonFrost for
the load/print a font.

--Colors 
white=(255,255,255) 

--Font 
font=Font.load("font.ttf") 
font:setPixelSizes(0,10) 

--Functions 
function printCenteredfont(y,text,color) 
local length = string.len(text) 
local x = 240 - ((length*8)/2) 
screen:fontPrint(font,x,y,text,color) 
end 

--Main Loop 
while true do 
screen:clear() 
printCentered(100,"Wow, its my font and its in the middle!",white) 
screen.waitVblankStart() 
screen.flip() 
end

Back to CodeBase
 

Please welcome stepbrother1988, our newest member.

Who's Online:

Total Members: 844
Total Posts: 13009
Total Topics: 1473
Total Categories: 7
Total Boards: 25

Recent Posts:

Re: chek it out i made front page of qj.net by chi-kitory
Re: chek it out i made front page of qj.net by Rick
Re: Hi everyone (remember me? :P) by Tdude_gamer
Re: Hi everyone (remember me? :P) by dan369
Hi everyone (remember me? :P) by Tdude_gamer
Re: Hows everyone doing? by osgeld
Re: Homebrew Idol 3: The Homebrew Horror Show by dan369
Problem on Tag game by andykd7


Copyright © 2006-2009 www.EvilMana.com All rights reserved.
EvilMana Logo by emcp and Charlie