Debug
Joined: 06 Oct 2005 Posts: 16
|
Posted: Wed Oct 19, 2005 7:35 pm Post subject: Outlined text |
|
|
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
}
|
|
|