System.usbDiskModeActivate()

font = Font.load("Geek a byte 2.ttf")
font:setPixelSizes(15,20)

rot = Color.new(255,0,0)
blau = Color.new(0,0,255)
weiss = Color.new(255,255,255)

battr = System.powerGetBatteryLifePercent()


BG = Image.load("Tester.png")
cross = Image.load("Button/X Pressed.png")
square = Image.load("Button/Square Pressed.png")
triangle = Image.load("Button/Triangle Pressed.png")
circle = Image.load("Button/O button.png")
square = Image.load("Button/Square Pressed.png")
Ltrig = Image.load("Button/L Pressed.png")
Rtrig = Image.load("Button/R Pressed.png")
Down = Image.load("Button/DDown Pressed.png")
Left = Image.load("Button/DLEFT Pressed.png")
Up = Image.load("Button/DUP Pressed.png")
Right = Image.load("Button/DRIGHT Pressed.png")



while true do 
screen:clear()
screen:blit(0,0,BG,true)

pad = Controls.read()

if pad:up() then 
screen:blit(0,0,Up)
screen:fontPrint(font,10,260," D-PAD UP is working!",blau) 
end

if pad:down() then
screen:blit(0,0,Down)
screen:fontPrint(font,10,260," D-PAD DOWN is working!",blau) 
end

if pad:left() then
screen:blit(0,0,Left)
screen:fontPrint(font,10,260," D-PAD LEFT is working!",blau) 
end

if pad:right() then 
screen:blit(0,0,Right)
screen:fontPrint(font,10,260, " D-PAD RIGHT is working!",blau) 
end

if pad:l() then 
screen:blit(0,0,Ltrig)
screen:fontPrint(font,10,260," LEFT SHOULDER BUTTON is working!",blau) 
end

if pad:r() then 
screen:blit(0,0,Rtrig)
screen:fontPrint(font,10,260, " RIGHT SHOULDER BUTTON is working!",blau) 
end

if pad:triangle() then
screen:blit(0,0,triangle)
screen:fontPrint(font,10,260," TRIANGLE is working!",blau)
end

if pad:circle() then 
screen:blit(0,0,circle)
screen:fontPrint(font,10,260, " CIRCLE is working!",blau) 
end

if pad:cross() then 
screen:blit(0,0,cross)
screen:fontPrint(font,10,260," X is working!",blau) 
end

if pad:square() then 
screen:blit(0,0,square)
screen:fontPrint(font,10,260," SQUARE is working!",blau) 
end

if pad:start() then 
screen:fontPrint(font,10,260," START is working!",blau) 
end

if pad:select() then 
screen:fontPrint(font,10,260,"SELECT is working!",blau) 
end

if pad:cross() and pad:circle() then
BG = nil
cross = nil
square = nil
triangle = nil
circle = nil
square = nil
Ltrig = nil
Rtrig = nil
Down = nil
Left = nil
Up = nil
Right = nil
dofile("LUATool.lua")
end

screen:print(300, 10, "Batterie-Status:", blau)
screen:print(440, 10, battr, rot)
screen:print(460, 10, "%", blau)



collectgarbage()
screen.waitVblankStart( )
screen.flip()
end