Closed greysondn closed 5 years ago
Flash has a hard limit on bmd size, 8191 pixels w or h and 16,777,215 total pixels. So this doesn’t have anything to do with flixel.
I'm having a devil of a time converting that from an ever-expanding scrollback into a limited buffer (which is the traditional model here). The issue with mouse events still hasn't been resolved AFAICT, so label
remains my dumping ground for displaying a text scrollback for now.
Scrolling to a fixed point in that on output is proving surprisingly hard. (It was surprisingly easy when output was scrolled to after adding more content.) I'm at the point where I'm thinking I'm stuck generating a new label when it reaches too large a size (and keeping a scrollback buffer in an array) for now as a workaround, but would encourage you to continue work on this.
I'm also at the point where publication platform is about to get a hard poke to implement HTML5 support already :o)
scrolling to a fixed point in that
I can tell I'm disorganized and not awake, my apologies.
So I tried to implement it as a limited buffer, where I just destroy part of the text (at the start of the buffer) when it gets too large. Standard faire probably expressed in an awkward way.
It seems that labels maintain their height even when content changes. Something is screwy, anyway. Trying to scroll on that to a fixed point in the text is proving all but impossible. I've tried the math several ways around and I'm convinced either it's impossible or (as is often the case at the end of the day) I'm an idiot.
A helper for scrolling to a specific point in text would be immeasurably useful, though. I'm having a devil of a time estimating exactly where a character is in spatial terms.
Oh yeah, definitely hitting the Flash pixel limit for bmds. On other targets, the updates take an extremely long time and essentially freeze the game.
Regarding your other point, you can use the TextLineMetrics or character boundaries of the internal TextField (myFlxText.textField.getCharBoundaries
), which gives you where that specific character is laid out. I'm closing this issue, but feel free to ask further about that on Discord or something.
Created a simple project to demonstrate this. Target flash to trigger.
eli-2.zip