If I am understanding correctly, when I apply a filter to a DisplayObject a new Texture is created. How can I retrieve that texture? I want to check how big is the generated texture.
Get the texture of a filter(5 posts) (2 voices)
Currently, you can't access this texture. However, in the current implementation, the size of the texture should have the following size:
var stageBounds:Rectangle = object.getBounds(stage); var scale:Number = Starling.contentScaleFactor; var filterWidth:Number = getNextPowerOfTwo(stageBounds.width * scale); var filterHeight:Number = getNextPowerOfTwo(stageBounds.height * scale);
(Except if we're talking about a blur filter, then you have to add the 'margin' values, too.)
Sorry that there's no easier way right now — maybe I'll add such a property in the future.
In the blur filter there is a resolution parameter, don't you use that too to define the final size of the texture?
I think it would be helpful to know more about those textures, especially when using mobile devices with crazy high resolutions.
Hi Daniel should I create an issue tracker on Git for this or its already in your wishlist for new features to add?
Also when is Starling 2.0 going to be officially published? Thanks
Yes, please create an issue for that on GitHub — then it's less likely that I overlook that when I work on the update.
Any date for v2.0 would be pure speculation, but I'd like to have it out this year (2015), in any case!
You must log in to post.