Hi Corona!
I have been playing around with snapshots and looked at your docs at http://docs.coronalabs.com/guide/graphics/snapshot.html.
However, the snapshots don’t seem to be rendering offscreen as stated below:
“Snapshot objects are easily created using Corona’s display.newSnapshot() method. You can add children objects to snapshots by accessing the snapshot’s group. This property is like a normal GroupObject but it does not directly affect the scene. Instead, these objects are rendered to a texture offscreen , and the texture determines what the snapshot renders.”
You have example code on the same page that I tried and it seems to render it all ON SCREEN:
local snapshot = display.newSnapshot( 200, 200 ) math.randomseed( 0 ) -- Add 4 fish images to the screen for i = 1,4 do -- Create a fish local fish = display.newImage( "fish-small-red.png" ) -- Move it to a random position relative to the snapshot's origin fish:translate( math.random( -100, 100 ), math.random( -100, 100 ) ) -- Insert the fish into the snapshot snapshot.group:insert( fish ) end snapshot:translate( display.contentCenterX, display.contentCenterY ) -- Center the snapshot on the screen snapshot:invalidate() -- Invalidate the snapshot transition.to( snapshot, { alpha=0, time=2000 } ) -- Fade the snapshot out
I don’t understand why there is the snapshot:translate(…) line. How can you center the snapshot on the screen if snapshots are not supposed to render to the screen?
If you omit that line of code, the snapshot is still rendered to the screen anyway.
Can somebody explain to me what is going on?
Thanks in advance!