24.07.2012, 12:43
Hi leute, Ich bin kurz davor die neue version von achtung die Kurve rauszubringen aber ich hab ein problem.
auf dem PC funzt alles ohne porbleme, also "lua playerfor windows" , wenn ich diesen code aber in die PSP tue kommt folgende fehlermeldung:
auf dem PC funzt alles ohne porbleme, also "lua playerfor windows" , wenn ich diesen code aber in die PSP tue kommt folgende fehlermeldung:
Code:
Error: SCRIPT.LUA:13: Font.load: can't open font file.
und dazu ist in zeile 13 ja nur ein tabellen feld. in zeile 106 wird dieses auf den bildschirm gebracht. dort finde ich aller dings auch keinen fehler.
oder liegt es vieleicht am luaplayer? ich hab luaplayer HM7 habe aber auch schon HM2 und HM8 ausprobiert.
und m es klar zu stellen:
ja ich habe die fonts file am richtigen platz.
ja ich weiß, es ist der code der neutrosider in einem tut vorgestellt hat... Ich progrmmiere kleine Spiele und nicht menüs
Code:
white = Color.new(255,255,255)
black = Color.new(0,0,0)
red = Color.new(255, 0, 0)
green = Color.new(255, 0, 0)
blue = Color.new(0,0,255)
light_blue = Color.new(0,180,255)
orange = Color.new(235,115,0)
yellow = Color.new(255,255,0)
gray = Color.new(160,160,160)
punkte={}
punkte[1]="Start" -- ZEILE 13!!!!
punkte[2]="Optionen"
punkte[3]="Credits"
punkte[4]="Beenden"
font = Font.load("fonts/arialsmall.ttf")
font:setPixelSizes(25,23)
fontb = Font.load("fonts/bankgoth.ttf")
fontb:setPixelSizes(40,55)
f={}
f[1]=function ()
dofile("script2.lua")
end
f[2]=function ()
dofile("options.lua")
end
f[3]=function ()
dofile("credits.lua")
end
f[4]=function ()
System.Quit()
end
current = 1
farbe={}
ypos=15
oldpad=Controls.read()
while true do
pause=0
pad =Controls.read()
screen:clear()
if pad:up() then
if current>1 then
current=current-1
pause=6
end
if ypos<30-(current*15) then
ypos=30-15*current
end
end
if pad:analogY()<-30 then
if current>1 then
current=current-1
pause=pad:analogX()/128
end
if ypos<30-(current*15) then
ypos=30-15*current
end
end
if pad:down() then
if current<table.getn(punkte) then
current=current+1
pause=6
end
if ypos>240-(current*15) then
ypos=0-(15*(current-17))
end
end
if pad:analogY()>30 then
if current<table.getn(punkte) then
current=current+1
pause=(pad:analogY()/127)*(-1)
end
if ypos>240-(current*15) then
ypos=0-(15*(current-17))
end
end
if current > table.getn(punkte) then
current = 1
else if current<1 then
current=table.getn(punkte)
end
counterfarbe=0
while counterfarbe<current do
counterfarbe=counterfarbe+1
farbe[counterfarbe]=black
end
counterfarbe=current
while counterfarbe<table.getn(punkte) do
counterfarbe=counterfarbe+1
farbe[counterfarbe]=black
end
farbe[current]=green
counter=0
yposa=ypos
ypos=ypos+100
while counter<table.getn(punkte) do
counter=counter+1
screen:fontPrint(font,10,ypos,punkte[counter],farbe[counter]) -- ZEILE 106!!!
screen:fontPrint(fontb,10,60,"Achtung Die Kurve",blue)
ypos=ypos+30
end
if pad:cross() then
f[current]()
end
end
ypos=yposa
screen.flip()
screen.waitVblankStart(pause)
oldpad=pad
end
schon mal danke
~ Manu