Thanks for the link. I’ve looked at that a bunch and just don’t seem to be getting it unfortunately.
Here’s a project I’ve been working on. My goal is to be able to use one button from the main scene to take a picture and then another button to switch scenes to view it. Do I seem to be on the right track? I have a bug related to my storyboard.gotoscene function that prevents me from successfully going to the 2nd scene. That’s weird to me becuase I pilaged this from something else I had worked on that did work!
This program does use the ui.lua library if anyone attempts to look at that.
main.lua
[blockcode]
display.setStatusBar(display.HiddenStatusBar)
local storyboard = require( “storyboard” )
local ui = require( “ui” )
image = display.newImage( “bg.jpg” )
local function newphoto ( event )
if (event.phase == “release”) then
media.show( media.Camera, sessionComplete )
return true
end
end
local function sessionComplete ( event )
t = event.target
local photot = display.newGroup()
photot:insert(t)
local baseDir = system.DocumentsDirectory
display.save(photot, “photo.jpg”, baseDir)
end
local button1Press = function( event )
newphoto ( event )
print( “\nbutton1Press function!” )
return true
end
local button1 = ui.newButton{
default = “buttonBlueSmall.png”,
over = “buttonBlueSmallOver.png”,
onPress = button1Press,
onRelease = button1Release,
text = “Shoot!”,
emboss = true
}
button1.x = 100; button1.y = 444
local button2Press = function( event )
–newphoto ( event )
print( “\nbutton2Press function!” )
storyboard.gotoScene( “photo_scene”, “slideLeft”, 800 )
return true
end
local button2 = ui.newButton{
default = “buttonBlueSmall.png”,
over = “buttonBlueSmallOver.png”,
onPress = button2Press,
onRelease = button2Release,
text = “View!”,
emboss = true
}
button2.x = 200; button2.y = 444
[/blockcode]
photo_scene.lua
[blockcode]
local baseDir = system.DocumentsDirectory
local img = display.newImage(“photo.jpg”,baseDir)
[/blockcode] [import]uid: 105707 topic_id: 25496 reply_id: 103012[/import]