02-07-2009 03:23 PM
I am currently doing some overcomplicated stuff to get word wrap to work using the Graphics.drawText function where I use the font.getAdvance function in a loop, character by character to see if the text hits the end of a line, break the line and add a hyphen or elipses if it's between a word or the end of my last line.
Is there ANY easier way using maybe a Label field with a transparent background or some other type of object with word wrapping built in?
02-07-2009 04:24 PM
I am overriding the paint function and am not sure how to use the rich text controls in that scenario. plus, are the rich text controls easily styled? I have a very specific style I am going for that works with a .png background and the BBAlpha Sans font.
To override paint and also have normal added controls would I just call super.paint(Graphics g) at the end of my paint function?
once again, sorry if it's n00b :-/
02-07-2009 10:07 PM
The font is no problem on a RichText control - you can set fonts and colors for various regions of the text, or for the entire text.
Regarding the background, are you painting a PNG as the background of a text field?
I've been down your path (I think!) and I wound up using the Manager to set/paint the background, then used the text field controls "as is". The reason was that I could not adequately duplicate all of the focus/text selection/wrapping issues with paint() overrides. The paint() events are delegated down through the components from Screen to Manager to Field, so this works out for me (ymmv).