BitmapText save/read issue


BitmapText extends Node so therefore can be saved as any Node using exporter.

However read/write are not overwritten, and no default contructor exist

so when we read it again we are getting

SEVERE: Could not access constructor of class ‘com.jme3.font.BitmapText’!

Some types need to have the BinaryImporter set up in a special way. Please doublecheck the setup.

28-Jul-2011 11:32:01 AM class com.jme3.export.binary.BinaryImporter readObject(int id)

SEVERE: Exception

java.lang.InstantiationException: com.jme3.font.BitmapText

at java.lang.Class.newInstance0(

at java.lang.Class.newInstance(

Thanks for the report, but it’s gonna be harder than I thought.

BitmapText have a final uninitialized attribute (BitmapTextPage[] textPages), the constructor of BitmapTextPage needs a BitmapFont, so basically we can’t have an empty BitmapText constructor…so it can’t be correctly saved.

@core teammates anyone has an idea why textPages is final? is it safe to make it non final? I know BitmapText are a bit unstable so I wouldn’t want to break it…

no worry. as workaround I remove them before save and add them back at init time.

Just make it non final. Also since we added a serialization and cloning test for particles it might be useful to have a similar test for fonts as well