-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libgdx]TwoColorPolygonBatch vertex format differs from other Batches #1121
Comments
I'm a little slow today, could you tell me how this is breaking the batch with BitmapFontCache? |
BitmapFontCache passes in vertices for a bunch of glyphs at once, but it doesnt know about additional float thats required for dark color. That makes it fail to render properly and all further draw calls until batch ends. |
Does it make sense to render text using a TwoColorPolygonBatch? It's not just BitmapFontCache, it's any code that assumes the vertex data is the same as SpriteBatch. |
While its clearly not needed, it makes it easier when you have one batch for everything. And the two color part is useful for gui, tho its somewhat out of scope for spine. |
I guess if we decide to do it, the most reasonable way is to have |
… Batch format (5 attribute/vertex), new methods are provided to accept float[] vertex data containing two colors. closes #1121
Looks like i didnt quite get it right in #1057, missed one corner case. Drawing text. BitmapFontCache uses
TwoColorPolygonBatch#draw (Texture texture, float[] vertices, int offset, int count)
and if theres more then 1 character it breaks the batch. Current solution cant be easily extended. Perhaps a flag for automatic conversion enabled by default?Something like this might do the trick https://gist.github.com/piotr-j/669d77fc9b385d12a9a40c7258bc8b58
The text was updated successfully, but these errors were encountered: