Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text whitespace stripping is wrong. Displays previous trailing characters when setting to a shorter String #33

Closed
nicolasgramlich opened this issue Feb 9, 2012 · 3 comments
Assignees

Comments

@nicolasgramlich
Copy link
Owner

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

@ghost ghost assigned nicolasgramlich Feb 9, 2012
@nicolasgramlich
Copy link
Owner Author

Thanks for reporting!

Fixed in a536d63 .

@sjvc
Copy link
Contributor

sjvc commented Feb 10, 2012

Thanks! :D

@bhecox65
Copy link

bhecox65 commented Mar 8, 2012

I think this issue may not be 100% fixed. I am having the same problem where old letters are being displayed on top or after a text (TickerText in my case) after it has been set to a new string. This occurs when the string is smaller or even larger than the previous string, with random letters appearing in the same space as the new letter.
I have checked that there is nothing wrong with the actual string by outputting it to the log.
Also, the problem is possibly occuring more often when the tick speed is higher (i.e. 60 instead of 15). I have some screen shots but photobucket is not working for me right now...
Edit- here are some screen shots:
http://i1062.photobucket.com/albums/t500/bhecox65/Starscape/textbug1.png
http://i1062.photobucket.com/albums/t500/bhecox65/Starscape/textbug2.png
http://i1062.photobucket.com/albums/t500/bhecox65/Starscape/textbug3.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants