Here's a better approach I found after the link above.
You set the viewport size to the size you want.
Next scroll to the center of what you want to capture.
Then use the snapshot canvas action.
When it's done you can then set the viewport back to normal and scroll back so it's centered.
Thanks for the reply.
Sorry but I did not understand the difference between what I did and what you suggested.
You have suggested the following in that post:
—
You can use the Snapshot action instead. For for a 100x100 image centered on position 50x50 you could do this:
---Set canvas size to 100x100
---scroll to (50, 50)
---Take Snapshot
on snapshot
---set canvas size to 640x480
---scroll to (320,240)
---invoke download of canvasScreenshot
The second scroll to is to scroll back to the original scroll location. If the layout isn't using unbounded scrolling you could also use (0,0).
Is it not the same?
My code:
Just to illustrate:
Obs: The "screen" sprite is the grey rectangle and the canvas plugin is filling all the white area.