Text in jME

While trying to find out how the FPS text always stayed with the camera, I discovered that it’s simply rendered onto the main screen, and not in the actual world, and therefore is always on top. So, as far as I understand it (or don’t), text in jME cannot exist as an object in the world (i.e. just floating there). If I’m not missing anything, and this is true, then one wouldn’t be able to implement such features as names on top of players in the game that follow them around.



So wouldn’t it be better to allow text to float around in the world as any other object? Then you guys could change SimpleGame to put the camera in a CameraNode, and add the FPS text to that node.



I’m probably missing something, but if I’m not, could these changes be considered?

Text should stay in the zplane of the screen, or it wouldn’t be readable. That said, there is nothing stopping it from scaling and translating relative to some world object. I do that in Dirt for the damage flashes.



For example, this grabs the screenlocation of the victim being hit and stores it in the local translation of the Text object:


DisplaySystem.getDisplaySystem().getScreenCoordinates(m_victim.getModel().getWorldTranslation(), myText.getLocalTranslation());