font problem

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

font problem

Post by the underminer »

I use 0.16. I spent a full 2 hours without result. what's wrong with my code?

Code: Select all

System.usbDiskModeActivate()
AlphaBlack = Color.new(0,0,0,125)
Green = Color.new(21,165,69)
ActFont = Font.createMonoSpaced()
ActFont:setPixelSizes(14, 14)
MenuScreen = Image.createEmpty(480,272)
MenuScreen:fontPrint(ActFont,100,100,"hello world",Green)
screen:blit(0,0,MenuScreen)
screen.flip()
while true do end 
the result is:nada (nothing). just a black screen
[edit]
when I change it to this it works

Code: Select all

System.usbDiskModeActivate()
AlphaBlack = Color.new(0,0,0,125)
Green = Color.new(21,165,69)
ActFont = Font.createMonoSpaced()
ActFont:setPixelSizes(14, 14)
MenuScreen = Image.createEmpty(480,272)
screen:fontPrint(ActFont,100,100,"hello world",Green)
--screen:blit(0,0,MenuScreen)
screen.flip()
while true do
if Controls.read():start() then break end
 end 
seems that you must print it directly to screen. can anyone confirm this?
Behold! The Underminer got hold of a PSP
kErov4
Posts: 3
Joined: Sat Sep 30, 2006 8:53 pm

Post by kErov4 »

blit the MenuScreen BEFORE print "hello world"
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

Fontprint should work on all images.
kErov4
Posts: 3
Joined: Sat Sep 30, 2006 8:53 pm

Post by kErov4 »

Of course; but he is hidding the text with the "background", so draw first MenuScreen, then write the text
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

MenuScreen:fontPrint(ActFont,100,100,"hello world",Green)
screen:blit(0,0,MenuScreen)

Doesnt look like that to me!
kErov4
Posts: 3
Joined: Sat Sep 30, 2006 8:53 pm

Post by kErov4 »

Ok my noob mistake, i mixed the 1st and the 2nd code and don't saw the MenuScreen:fontPrint; thought it was screen:fontPrint too =/
Post Reply