"display.captureScreen( saveToAlbum )" problem

Hi,
I tried to use function “display.captureScreen( true )” and it worked well.
However, after it captured the screen, other object became unfunctional.

Here is a simple code:

local ui = require("ui")  
  
local capture = function( event )  
display.captureScreen( true )  
transition.to( rect, {y=200, time=1000 } )  
end  
  
local move = function( event )  
transition.to( rect, {y=400, time=1000 } )  
end  
  
button = ui.newButton{  
 default = "button.png",  
 x=200,  
 y=200,  
 onPress = capture  
 }  
  
button2 = ui.newButton{  
 default = "button.png",  
 x=200,  
 y=300,  
 onPress = move  
 }  
  
rect = display.newRect( 20, 20, 100, 100 )  
rect:setFillColor( 255,0,0 )  

For example, object “rect” is not movable after I added “display.captureScreen( true )”
I assumed it’s a bug? [import]uid: 4992 topic_id: 1300 reply_id: 301300[/import]

I don’t think it’s a bug. When you captured the screen it added the image to the front of the stage (hiding the other objects). When you clicked on button2 the object was moved but your screen capture was still on top.

I changed your code to make “rect” the top-most object after the screen capture.

local capture = function( event )  
display.captureScreen( true )  
rect.parent:insert(rect) -- re-insert to move it to front of display stack  
transition.to( rect, {y=200, time=1000 } )  
end  

-Tom [import]uid: 6119 topic_id: 1300 reply_id: 3529[/import]

Got it! Thank you very much! [import]uid: 4992 topic_id: 1300 reply_id: 3540[/import]