-
Im trying to add "Label" entities to my main game entities using a Text2DBundle. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I've been meaning to look at this but haven't got around to it. There is a second issue as well: Text2d rendering isn't very optimised and it just extracts an individual sprite for each glyph. So with hundreds of labels you could be extracting tens of thousands of sprites. As a temporary fix you could set up your own visibility system, |
Beta Was this translation helpful? Give feedback.
I've been meaning to look at this but haven't got around to it.
There is a second issue as well: Text2d rendering isn't very optimised and it just extracts an individual sprite for each glyph. So with hundreds of labels you could be extracting tens of thousands of sprites.
As a temporary fix you could set up your own visibility system,
Text2dBundle
has aTextLayoutInfo
component with a size field that contains the size of the text. You can use that to create a bounding box which you can test to if it's on screen and if not set it non-visible yourself.