BitmapText Newline/Return?

Hey everybody,



Is there a way to be able to force text inside of a BitmapText (with box) to go to the next line?  In the widget abstraction I've made I kinda need to be able to lay out a HUD with a couple lines using one BitmapText instead of a bunch of them like in StatsView.  They'll wrap if the text exceeds the rectangle's width, but currently it just ignores n characters.  Is there a trick I'm missing here?



Thanks!

You need to set a rectangle to limit the text:

BitmapText txt = ...
txt.setBox(new Rectangle(0, 0, 500, 100));

Originally, the BitmapText didn't have that feature. I added it a few months back in jme2, maybe someone can take a look at it and add it in jme3.

I've set the rectangle, but I still can't force a carriage return.  n and rn are both seemingly filtered out of the string and all the text appears on one line, only wrapping when it hits the end of the rectangle's width.  Am I missing something?



Thanks!

dhdd said:

Originally, the BitmapText didn't have that feature. I added it a few months back in jme2, maybe someone can take a look at it and add it in jme3.


wtf, am I writing in cyrillic?  ;)
dhdd said:

dhdd said:

Originally, the BitmapText didn't have that feature. I added it a few months back in jme2, maybe someone can take a look at it and add it in jme3.


wtf, am I writing in cyrillic?  ;)

Yup. We should join forces and write cyrillic together! :D

rmnoon said:

I've set the rectangle, but I still can't force a carriage return.  n and rn are both seemingly filtered out of the string and all the text appears on one line, only wrapping when it hits the end of the rectangle's width.  Am I missing something?

Thanks!

I think I somehow got confused with the newlines and the rectangle thing, I'll see what I can do.

With regards to the cyrillic…I thought you were referring to the rectangular bounding feature, not the newlines. :slight_smile:



Thanks for looking into it!

oh, now that I reread it I realize I was being unclear  :expressionless:

Feature added :slight_smile:

Update from SVN

rockin, thanks!