white = Color.new(210,210,210)
red = Color.new(180,30,30)
blue = Color.new(20,20,150)
green = Color.new(30,180,30)
bild = Image.load("bg.png")
counter = Timer.new()
font = Font.load("bankgoth.ttf")
font:setPixelSizes(13,15)
fontarial = Font.load("arial.ttf")
fontarial:setPixelSizes(25,30)
fontbig = Font.createProportional()
fontbig:setPixelSizes(0, 30)
arialsmall = Font.load("arialsmall.ttf")
arialsmall:setPixelSizes(13,12)
fontarialkomma = Font.load("arial.ttf")
fontarialkomma:setPixelSizes(23,27)
while true do
screen:clear()
pad = Controls.read()
runtime = counter:time()
screen:blit(0,0,bild,true)
if pad:cross() then
counter:start()
end
if pad:circle() then
counter:stop()
end
if pad:square() then
counter:reset(0)
end
if runtime > 1 and runtime < 10000 then
screen:fontPrint(fontarialkomma,180,136,",",white)
end
if runtime > 10000 and runtime < 100000 then
screen:fontPrint(fontarialkomma,194,136,",",white)
end
if runtime > 100000 and runtime < 1000000 then
screen:fontPrint(fontarialkomma,208,136,",",white)
end
if runtime > 1000000 and runtime < 10000000 then
screen:fontPrint(fontarialkomma,222,136,",",white)
end
if runtime > 10000000 and runtime < 100000000 then
screen:fontPrint(fontarialkomma,236,136,",",white)
end
if runtime > 100000000 and runtime < 1000000000 then
screen:fontPrint(fontarialkomma,250,136,",",white)
end
if runtime > 1000000000 and runtime < 10000000000 then
screen:fontPrint(fontarialkomma,264,136,",",white)
end
screen:fontPrint(fontarial, 15, 136,"Aktuelle Zeit: " .. runtime,white)
screen:fontPrint(arialsmall,1,10,"X = Startet den Timer",blue)
screen:fontPrint(arialsmall,1,23,"O = Stopt den Timer",blue)
screen:fontPrint(arialsmall,1,36,"[] = Setzt den Timer auf null",blue)
screen:fontPrint(font,1,269," version 0.01 Homebrew made by Manu",red)
screen.waitVblankStart()
screen.flip()
end
[color=#FF0000]runtime = counter:time()[/color]