Hello,
When I upgraded to 1.3, I noticed that the recodings do not include recording of the keyboard and touches. So I went a little farther and created this library to enhance your recordings. It’s a little sloppy right now, but it will do.
function setup()
touches = {}
showKeyboard()
end
function draw()
background(0, 0, 0, 255)
enchanceRecording(CurrentTouch.x, CurrentTouch.y,1)
end
function enchanceRecording(gravx,gravy,shoingkeyboard)
local buffer = keyboardBuffer()
local _, gravh = textSize(Gravity.x)
if isRecording() then
font("HelveticaNeue")
fill(179, 179, 179, 127)
stroke(255, 255, 255, 127)
strokeWidth(3)
for k,touch in pairs(touches) do
ellipse(touch.x, touch.y, 100, 100)
end
if shoingkeyboard == 1 then
if buffer == nil then buffer = " " end
textWrapWidth(WIDTH)
if WIDTH == 1024 and HEIGHT == 768 or WIDTH == 750 and HEIGHT == 768 then
rect(0,0,WIDTH,HEIGHT/2-30)
fill(255, 0, 0, 255)
text("Typed text:".. buffer,WIDTH/2,(HEIGHT/2-30)/2)
elseif WIDTH == 768 and HEIGHT == 1024 or WIDTH == 494 and HEIGHT == 1024 then
rect(0,0,WIDTH,HEIGHT/3-75)
fill(255, 0, 0, 255)
text("Typed text:".. buffer,WIDTH/2,(HEIGHT/3-75)/2)
end
fill(30, 255, 0, 255)
text("Gravity X: ".. Gravity.x,gravx,gravy)
text("Gravity Y: ".. Gravity.y,gravx,gravy-gravh)
text("Gravity Z: ".. Gravity.z,gravx,gravy-gravh*2)
text("User Acceleration X: ".. UserAcceleration.x,gravx,gravy-gravh*4)
text("User Acceleration Y: ".. UserAcceleration.y,gravx,gravy-gravh*5)
text("User Acceleration Z: ".. UserAcceleration.z,gravx,gravy-gravh*6)
end
end
end
function touched(touch)
if touch.state == ENDED then
touches[touch.id] = nil
else
touches[touch.id] = touch
end
end
That turns out like this:
If the video doesn’t work, click here.
What’s left to do? This:
- Get rid of all the unnecessary numbers in the user acceleration and gravity.
- And a few other small things I don’t feel like listing right now.
Have fun!