Closed AlBirdie closed 11 years ago
and merely scroll the image
ScrollText is for cases when you cannot scroll an image because it is larger than the 2048x2048 texture limit. If you can ensure that your texture can fit in 2048x2048 texture, you should be using TextFieldTextRenderer instead of ScrollText.
Didn't even think about the limited texture size. Thanks for the heads up. So no chance for making ScrollText a little more user capable. Darn.
Naturally the 2048 pixels won't do it, especially not on an iPad. Wondering if the StageWebView approach would be a viable alternative.
The only alternative I can see is taking bitmap/texture snapshots of the visible region of ScrollText. Then, as it scrolls, take another snapshot and replace the texture on the GPU. This will probably affect scrolling performance significantly.
Yes, probably going to do something like like, even though taking a snapshot once the scrolling has finished should suffice, thus not affecting scrolling performance.
Thanks Josh!
Josh, I came up with another idea and just wanted to ask you whether you think its feasible. Instead of using ScrollText at all, I thought about splitting the String in chunks and creating a regular TextFieldTextRenderers for each chunk. These Renderers would then be placed vertically in a Scroller.
Would that work or does the texture size limit apply to this workaround as well?
Also, in this thread (http://forum.starling-framework.org/topic/scrolling-over-a-long-text) Daniel mentions to simply use a bitmap font for very long texts (<8193 characters). Would that work with the BitmapFontTextRenderer?
Yes, you could break up TextFieldTextRenderers into lines. That would work. Your new limitation would be the number of textures that may be created, but that should be a little harder to reach.
Also, yes, long passages of text can also be drawn with bitmap fonts.
Good to know. Thanks again!
Sitting on top of Starling, the flash display list based ScrollText is somehow limited in its usage and just won't do it for applications that can display controls over this text, such as a news reading app.
I'm wondering if there isn't a way to overcome this issue, maybe by taking a snapshot of the text once it has been displayed, dispose the Scrolltext and merely scroll the image. IIRC this is how the Flex UIComponent StageWebView component is done. You can check it out here: http://www.judahfrangipane.com/blog/2011/01/16/stagewebview-uicomponent/
Not sure if its applicable at all, but a ScrollText that can be used like a regular Starling component would be a very nice feature indeed!