I basically want to use Codea to program something akin to a small slide full screen show app (it’s more specialised but this is the least complicated to explain analogy). I would like to be able to hold the ipad and use the hardware volume keys to move to the next / previous slide.
Can this be done from Codea? Or can I query the current system volume setting? (And therefore just do this in my draw function to react to changes).
@Bene Codea doesn’t have access to the volume buttons. Here’s a simple program that will let you move from slide to slide just by swiping your thumb or finger on the screen in the direction you want to go. Right now I just us text with the numbers 1 to 15. You would replace the numbers in the table with the pictures you want to show.
displayMode(FULLSCREEN)
function setup()
fontSize(50)
tab={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
fill(255)
pos=1
end
function draw()
background(40, 40, 50)
if pos<1 then
pos=#tab
elseif pos>#tab then
pos=1
end
text("Slide "..tab[pos],WIDTH/2,HEIGHT/2)
end
function touched(t)
if t.state==BEGAN then
h=t.x
elseif t.state==ENDED then
if t.x<h then
pos=pos+1
end
if t.x>h then
pos=pos-1
end
end
end