sub_arctic.output
Class radial_gradient_text

java.lang.Object
  |
  +--sub_arctic.output.simple_text_renderer
        |
        +--sub_arctic.output.gradient_text_renderer
              |
              +--sub_arctic.output.radial_gradient_text
Direct Known Subclasses:
shadow_rad_grad_text

public class radial_gradient_text
extends gradient_text_renderer

Object for drawing of text with a radial gradient pattern in one of several standard styles.


Field Summary
protected  int _draw_style
          Drawing style used for gradient.
static int BL_GRAD
          Style code constant for top-left centered gradient
static int BR_GRAD
          Style code constant for top-left centered gradient
static int CENT_GRAD
          Style code constant for centered gradient
static int LAST_GRAD_STYLE
          Last valid style code value
static int TL_GRAD
          Style code constant for top-left centered gradient
static int TR_GRAD
          Style code constant for top-left centered gradient
 
Fields inherited from class sub_arctic.output.gradient_text_renderer
_draw_gradient
 
Fields inherited from class sub_arctic.output.simple_text_renderer
_draw_color, _draw_font, _metrics
 
Constructor Summary
radial_gradient_text(java.awt.Font in_font, gradient in_grad, int in_style)
          Construct a renderer given a Font, a gradient, and a style code.
 
Method Summary
 int draw_style()
          Drawing style used for gradient.
 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.
 void set_draw_gradient(gradient grad)
          Set the gradient to draw text in.
 void set_draw_gradient(radial_gradient grad)
          Set the gradient to draw text in.
 void set_draw_style(int style_code)
          Set the drawing style used for gradient.
 
Methods inherited from class sub_arctic.output.gradient_text_renderer
draw_gradient
 
Methods inherited from class sub_arctic.output.simple_text_renderer
baseline, draw_color, draw_font, h, leading, set_draw_color, set_draw_font, w
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TL_GRAD

public static final int TL_GRAD
Style code constant for top-left centered gradient

BL_GRAD

public static final int BL_GRAD
Style code constant for top-left centered gradient

TR_GRAD

public static final int TR_GRAD
Style code constant for top-left centered gradient

BR_GRAD

public static final int BR_GRAD
Style code constant for top-left centered gradient

CENT_GRAD

public static final int CENT_GRAD
Style code constant for centered gradient

LAST_GRAD_STYLE

public static final int LAST_GRAD_STYLE
Last valid style code value

_draw_style

protected int _draw_style
Drawing style used for gradient. This must be one of {TL,BL,TR,BR,CENT}_GRAD.
Constructor Detail

radial_gradient_text

public radial_gradient_text(java.awt.Font in_font,
                            gradient in_grad,
                            int in_style)
Construct a renderer given a Font, a gradient, and a style code. A clone of the gradient will be adjusted to match the style.
Parameters:
Font - in_font font that this renderer uses.
radial_gradient - in_grad gradient that the actual text is drawn with.
int - in_style style code indicating direction of gradient. Must be one of: {TL,BL,TR,BR,CENT}_GRAD.
Method Detail

set_draw_gradient

public void set_draw_gradient(gradient grad)
Set the gradient to draw text in. Gradient must be a radial_gradient or an error is thrown.
Parameters:
gradient - grad the new radial gradient for drawing
Overrides:
set_draw_gradient in class gradient_text_renderer

set_draw_gradient

public void set_draw_gradient(radial_gradient grad)
Set the gradient to draw text in.
Parameters:
radial_gradient - grad the new gradient for drawing

draw_style

public int draw_style()
Drawing style used for gradient. This will be one of {TL,BL,TR,BR,CENT}_GRAD.

set_draw_style

public void set_draw_style(int style_code)
Set the drawing style used for gradient. If this is not one of {TL,BL,TR,BR,CENT}_GRAD, an error will be thrown.
Parameters:
int - style_code the new drawing style code.

draw_text

public 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.
Parameters:
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.
Overrides:
draw_text in class gradient_text_renderer