Okay, so I can load pictures alright, but no matter what I try and change and mess about with, I can't get:
arial = Font.load("arial.ttf")
to work
I always get:
error: index.lua:10: attempt to index global `Font' (a nil value)
The font file's most defintely in the right directory, as I can load normal pictures without fail. I've tried everything. I'm using the windows LuaPlayer. Please tell me this is not a problem...
Oh and one more thing: I tried doing the cygwin tut, got up until the last step, and it told me when I tried to build it for windows: it comes up with some errors on luacontrols and missing headers and stuff like that...
Any help is gladly appreciated...
error: (a nil value)
Moderators: Shine, Insert_witty_name
TTF support (v0.16) is not available in windows luaplayer (v 0.14).
See: http://www.luaplayer.org/
Lee
See: http://www.luaplayer.org/
Lee
I also do all my testing on the windows luaplayer, and because of that, I have avoided using any of the 0.16 features such as TTF.
If you want to write text to the screen, you'll either have to use screen:print (basic monospaced 8pixel font) or use a bitmap font (someone released a bitmap font library a while ago here).
http://forums.ps2dev.org/viewtopic.php? ... itmap+font
If you want to be able to test on the windows luaplayer whilst still using 0.16 features on the PSP, the way I see it you have 2 choices:
1. Add the features yourself to the windows luaplayer binary (non-trivial).
2. Stub out the missing functions in a seperate .lua file, and remove the stub file when deploying to PSP.
e.g. Create a function:
If you want to write text to the screen, you'll either have to use screen:print (basic monospaced 8pixel font) or use a bitmap font (someone released a bitmap font library a while ago here).
http://forums.ps2dev.org/viewtopic.php? ... itmap+font
If you want to be able to test on the windows luaplayer whilst still using 0.16 features on the PSP, the way I see it you have 2 choices:
1. Add the features yourself to the windows luaplayer binary (non-trivial).
2. Stub out the missing functions in a seperate .lua file, and remove the stub file when deploying to PSP.
e.g. Create a function:
Code: Select all
function Font.load(fontName)
io.write("Stubbed font load function.\n")
end
thx for the pointers. I don't quite understand what you mean with stubbing out the functions. What I did now was find and replace, it's simple enough, I just hope that the .ttf is the only problem I'll be experiencing...fullerlee wrote:I also do all my testing on the windows luaplayer, and because of that, I have avoided using any of the 0.16 features such as TTF.
If you want to write text to the screen, you'll either have to use screen:print (basic monospaced 8pixel font) or use a bitmap font (someone released a bitmap font library a while ago here).
http://forums.ps2dev.org/viewtopic.php? ... itmap+font
If you want to be able to test on the windows luaplayer whilst still using 0.16 features on the PSP, the way I see it you have 2 choices:
1. Add the features yourself to the windows luaplayer binary (non-trivial).
2. Stub out the missing functions in a seperate .lua file, and remove the stub file when deploying to PSP.
e.g. Create a function:Code: Select all
function Font.load(fontName) io.write("Stubbed font load function.\n") end
Thx fo rthe help again! :)
€DIT: Is there anything I can do to slow that shit down? I tap down and it's already at the bottom :(
If you only want to respond once per button press (as opposed to responding each cycle if a button is down), you can either use this function (put it just after you are handling the button press, it will basically pause execution until there are no buttons pressed):
Or, at the start of each cycle, you can test if the pad has changed, and only respond to events if it has:
eg:
Code: Select all
function Controls.waitpadup()
pad=Controls.read()
while pad:select() or pad:start() or pad:up() or pad:right() or pad:down() or pad:left() or pad:l() or pad:r() or pad:triangle() or pad:circle() or pad:cross() or pad:square() do
screen.waitVblankStart()
pad=Controls.read()
end
end
eg:
Code: Select all
while true do
pad=Controls.read()
if(pad ~= oldpad) then
oldpad=pad
if pad:start() then
elseif pad:cross() then
---etc
end
end
end