[open] backup a canvas for later reuse
how can I code this with Opensesame?
--copy the content of "mySketchpad" to myCanvas -- draw a text over myCanvas -- show myCanvas for 2000ms -- copy myCanvas to a "temporary" myBackupCanvas -- draw other text over myCanvas -- show myCanvas for 2000ms -- copy the myBackupCanvas over myCanvas -- show myCanvas for 2000ms
I tried something like this:
from openexp.canvas import canvas myCanvas=offline_canvas() myBackupCanvas=offline_canvas() myCanvas.copy(exp.items["mySketchpad"].canvas) myCanvas.text("some new text",y=400) myCanvas.show() self.time(2000) myBackupCanvas.copy(myCanvas) # make a backup copy myCanvas.text("other new text",y=800) myCanvas.show() self.time(2000) myCanvas.copy(myBackupCanvas) myCanvas.show() # ------------ remark here self.sleep(2000)
I would expect to see the backupCanvas at the end but instead I see a blank screen, like if the canvas was not copied and it was at its default init (blank)