nicolasgramlich/AndEngine — Issue #33: Text whitespace stripping is wrong. Displays previous trailing characters when setting to a shorter String
Author: nicolasgramlich
Created: 2012-02-09 23:05:24+00:00
State: open

Reported by @sjvc :

This is the code:

Text text1 = new Text(2, 100, myFont, "ThisIsTextWithoutWhiteSpaces", this.getVertexBufferObjectManager());
text1.setText("This has white spaces");
myScene.attachChild(text1);

Text text2 = new Text(2, 200, myFont, "This has white spaces", this.getVertexBufferObjectManager());
myScene.attachChild(text2);

This screenshot shows "weird result": http://i39.tinypic.com/9lehj4.png
This screenshot shows expected result after remove "if(!letter.isWhitespace())": http://i41.tinypic.com/xdxx5v.png

I don't know the correct way to solve it