forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Outlined text

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Debug



Joined: 06 Oct 2005
Posts: 16

PostPosted: Wed Oct 19, 2005 7:35 pm    Post subject: Outlined text Reply with quote

I have made a function to outline your text in black, very simple but handy for when you don't know what color your background will be, or if you want your text to stand out.

Code:
function printOutline(x,y,text, color)
   local x2, y2
   for x2 = 0,2 do
      for y2 = 0,2 do
         screen:print(x+x2, y+y2, text)
      end
   end
   screen:print(x+1,y+1,text,color)
end


I suppose you could use the same concept for bold...
Code:
function printBold(x,y,text,color)
     screen:print(x,y,text,color)
     screen:print(x+1,y,text, color)
end


...and here's one to write 2x sized text:
Code:
function strech(x,y,text,color)
   local buffer=Image.createEmpty(480,272)
   buffer:print(0,0,text,color)
   local b2 = Image.createEmpty(480,272)
   for x1 = 0, 240 do
      for y1 = 0, 136 do
         b2:blit(x1*2,y1*2,buffer,x1,y1,1,1)
      end
   end
   screen:blit(x,y,b2)
   screen:blit(x,y+1,b2)
   screen:blit(x+1,y,b2)
   screen:blit(x+1,y+1,b2)
end


I could write something that makes an image from a string to italicize it, but I'm too tired right now. I might after school tomorrow if anyone's interested.
_________________
Code:

catch(IOException e){
//oh crap
}
Back to top
View user's profile Send private message AIM Address
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Thu Oct 20, 2005 9:59 pm    Post subject: Reply with quote

well just define the leading of the italic and move the x of the image on each y over by whatever until you get to the bottom so

| becomes /
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group