I want to share a screenshot of my score using the Activity Popup plugin but it doesn’t seem to be finding the image or maybe even saving at all.
This is the error I get…
“display.save() first parameter was nil. Expected a display object”
What am I doing wrong?
Here is my screenshot code
function takePic( event ) local baseDir = system.DocumentsDirectory display.save(group,{ filename="myScreenshot.jpg", baseDir=system.DocumentsDirectory, captureOffscreenArea=true}) print("PIC SAVED") end
The function is called when the player hits the share button.
Activity popup function
function shareScore( event ) takePic() local itemsToShare = { { type = "image", value = { filename = "myScreenshot.jpg", baseDir = system.DocumentsDirectory } }, { type = "string", value = "Can you beat my score" }, } local options = { items=itemsToShare } native.showPopup( "activity", options ) end