Here's an example. Use collectgarbage() to prevent Codea from crashing when it updates img.
displayMode(FULLSCREEN)
function setup()
end
function draw()
background(40, 40, 50)
img=image(CAMERA)
collectgarbage()
if img~=nil then
sprite(img,WIDTH/2,HEIGHT/2)
end
end
Are you after something like this. Tap the screen to copy a section of the Camera image.
displayMode(FULLSCREEN)
function setup()
end
function draw()
background(0)
i = image(CAMERA)
collectgarbage()
if imgCopy~=nil then
sprite(imgCopy,WIDTH/2,HEIGHT/2)
elseif i~=nil then
sprite(i,WIDTH/2,HEIGHT/2)
end
end
function touched(t)
if t.state==BEGAN then
print(i)
imgCopy = i:copy(i.width/2, i.height/2, 500, 500)
end
end
Comments
Here's an example. Use collectgarbage() to prevent Codea from crashing when it updates img.
Why that doesn't work???
Are you after something like this. Tap the screen to copy a section of the Camera image.
Thanks!