How to get a bitmap screenshot for a 'big' sprite in starling?
-
26-06-2021 - |
Question
I want get a screenshot for a sprite in starling, I find this method:http://forum.starling-framework.org/topic/taking-a-screenshot-and-save-it-to-the-camera-roll . But when I want to take a screenshot for a sprite that larger than screen(I mean the target sprite is partly out of the screen), I only got in screen part of it. Need help~Thanks a lot!
Solution
You can see in the code where it is using the screen size to dictate the size of the bitmap:
var nativeWidth:Number = getNextPowerOfTwo(Starling.current.stage.stageWidth * scale);
var nativeHeight:Number = getNextPowerOfTwo(Starling.current.stage.stageHeight * scale);
Change those lines to have the width and height you want.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow