|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sub_arctic.output.simple_text_renderer
Object for simple drawing of text in a given font and color (both of which are retained by the object).
Field Summary | |
protected java.awt.Color |
_draw_color
Color that text gets drawn in |
protected java.awt.Font |
_draw_font
Font that text gets drawn in |
protected java.awt.FontMetrics |
_metrics
Cache of font metrics object for the current font. |
Constructor Summary | |
simple_text_renderer(java.awt.Font in_font,
java.awt.Color in_color)
Construct a renderer given a Font and a color to draw the text in. |
Method Summary | |
int |
baseline()
The baseline location associated with this renderer. |
java.awt.Color |
draw_color()
Color that text gets drawn in |
java.awt.Font |
draw_font()
Font that text gets drawn in. |
void |
draw_text(drawable on_surface,
int at_x,
int at_y,
java.lang.String txt)
Render text onto the given drawable object at the given location. |
int |
h(java.lang.String txt)
Height that the image of a given string drawn would take up. |
int |
leading()
The amount of spacing to be placed between lines of text rendered with this renderer. |
void |
set_draw_color(java.awt.Color clr)
Set the color that text gets drawn in. |
void |
set_draw_font(java.awt.Font fnt)
Set the font that text gets drawn in. |
int |
w(java.lang.String txt)
Width that the image of a given string drawn would take up. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.awt.Font _draw_font
protected java.awt.FontMetrics _metrics
protected java.awt.Color _draw_color
Constructor Detail |
public simple_text_renderer(java.awt.Font in_font, java.awt.Color in_color)
Font
- in_font font that this renderer uses.Color
- in_color color that this renderer uses.Method Detail |
public java.awt.Font draw_font()
public void set_draw_font(java.awt.Font fnt)
Font
- fnt the new font to draw in.public java.awt.Color draw_color()
public void set_draw_color(java.awt.Color clr)
Color
- clr the new color to draw with.public void draw_text(drawable on_surface, int at_x, int at_y, java.lang.String txt)
drawable
- on_surface the drawing surface where we draw the result.int
- at_x x coordinate to draw at.int
- at_y y coordinate to draw at.String
- txt the text to draw.public int w(java.lang.String txt)
String
- txt the string that will be drawn.public int h(java.lang.String txt)
String
- txt the string that will be drawn.public int baseline()
public int leading()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |