Problems With BitmapText

Hey guys i hope i dont mention anything that is already known but i want to warn you :
today i tried to run an app witch runs on my windows pc and it always resulted in opengl error 1285
after 3 hours of my head exploding i found the problem

i had a BitmapText attached to the guiNode but i didnt set a text! It seems that android cant handle it… but windows does…

1 Like

I just tried this and did not receive an opengl error 1285. Can you post how you set up the bitmaptext so I can try it?

1 Like

That’s an out of memory error. That’s strange.
If you set the text you don’t have the error?

I remember that @sbook fixed this about 5 months ago (nothing android specific tho), are you running nightly jME?

@wezrule said: I remember that @sbook fixed this about 5 months ago (nothing android specific tho), are you running nightly jME?

There were some changes I reverted some time back because they didn’t appear to do anything but break 5 other things. Maybe it’s related. That had to do with buffer resizing or something, I thought.

So I’m also curious which version the OP is running.

    TT = new BitmapText(guiFont, false);
    TT.setSize(guiFont.getCharSet().getRenderedSize());
    TT.setText("hhhh");
    TT.setLocalTranslation(100, 100, 0f);
    guiNode.attachChild(TT);

if i had TT.setText("") or just delete the line i get the error…

@wezrule said: I remember that @sbook fixed this about 5 months ago (nothing android specific tho), are you running nightly jME?

I haven’t touched BitmapText because I haven’t used it much with jME3 :stuck_out_tongue:

I do remember a flare-up in conversation around it in that timeframe though, and totally remember @pspeed saying something similar to what he’s saying here about what a mess it is to hack on.

I wonder if android is having a problem with a buffer of size 0 or something.

@sbook said: I haven't touched BitmapText because I haven't used it much with jME3 :p

oh rly? :wink:

https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/font/BitmapText.java?r=9389

(dam that was almost a year ago, time is flying too damn fast!!!)

r9389 by skye.book on May 18, 2012 Diff Fix for bug when assigning an empty text string to a BitmapText already showing content
@wezrule said: oh rly? ;)

https://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/font/BitmapText.java?r=9389

(dam that was almost a year ago, time is flying too damn fast!!!)

And my undoing of it with BAC (Big-ass comment): Google Code Archive - Long-term storage for Google Code Project Hosting.

Unrelated to the OP’s problem, I think… since it starts with no text in the first place.

Frankly forgot I had worked on that until I saw the commit and then duo up the original pair of threads about it… oops :frowning:

For reference, these are the original threads from almost a year ago:
http://hub.jmonkeyengine.org/forum/topic/crash-because-of-number-of-remaining-buffer-elements/
http://hub.jmonkeyengine.org/forum/topic/bitmap-text-bug/

Actually, it’s funny because the second thread is exactly the kind of problem I fixed by reverting your change… since recreating the text block without copying over all of the attributes was causing text to go weird if it ever went to “”.

I even got another problem…

when I change the Text you can still see some letters from the old Text…
Like changing from “Button4” to “Fire” you see “Fireon4”…but only on android again…

@TripleS said: I even got another problem......

when I change the Text you can still see some letters from the old Text…
Like changing from “Button4” to “Fire” you see “Fireon4”…but only on android again…

I know nothing about android development but this issue sounds familiar. What version of JME are you running, etc.?

http://hub.jmonkeyengine.org/forum/topic/changing-text-in-bitmaptext/

(may be fixed now, idk)

Yeah, @wezrule is right, it sounds like you are using the original RC2 version. The issue with leftover text characters was fixed a while ago, but there hasn’t been a stable updated or an RC3 to get the fix out unless you use the nightly version of the SDK or engine.

Try updating to the latest nightly of the SDK or engine and see if both issues go away.

Another note: When we fixed the issue with leftover text on Android, you don’t need to pad the text anymore. Just change the text to what you want and the leftover characters should not appear anymore.