espresso3d.engine.viewport.text
Class E3DMessage

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.renderer.base.E3DRenderable
          extended byespresso3d.engine.renderer.base.E3DTexturedRenderable
              extended byespresso3d.engine.viewport.text.E3DMessage

public class E3DMessage
extends E3DTexturedRenderable

Author:
Curt A message is a single piece of text that was added to the viewport for printing via the viewport's viewportPrinter. This is constructing out of the String message to be displayed, font, etc. It is constructed by the viewport printer and passed back to the user after it is added to the viewport for rendering.

Constructor Summary
E3DMessage(E3DEngine engine, E3DViewport viewport, java.lang.String text, espresso3d.engine.viewport.text.E3DFont font, double fontSize, E3DVector2I position, double life, E3DVector3F color)
          Create a message to be printed by the viewport printer.
E3DMessage(E3DEngine engine, E3DViewport viewport, java.lang.String text, espresso3d.engine.viewport.text.E3DFont font, double fontSize, E3DVector2I position, double life, E3DVector3F color, int blendMode)
          Create a message to be printed by the viewport printer.
 
Method Summary
 double getAge()
          Return the age, or, how long the message has been rendered
 E3DVector3F getColor()
          Return the color of the message
 E3DVector2I getCursorPositionAfterMessage()
          This returns the X, Y coords of the cursor after the last character in the message.
 espresso3d.engine.viewport.text.E3DFont getFont()
          Return the font object the message is bound to
 double getFontSize()
          Return the size of the font for the message
 double getLife()
          Get the life of the message, or, how many seconds it will be rendered in the engine.
 E3DVector2I getPosition()
          Get the 2D (x,y) position the message starts at.
 java.util.ArrayList getPositionedQuadList()
          This will return an arraylist of positioned, textured quads in 3D space for the message.
 java.lang.String getText()
          Get the text of the message that will be rendered in the viewport.
 void render()
           
 void setColor(E3DVector3F color)
          Set the color of the message.
 void setFont(espresso3d.engine.viewport.text.E3DFont font)
          Change the font object the message should use
 void setFontSize(double fontSize)
          Change the size of the font the message is using.
 void setPosition(E3DVector2I position)
          Set the 2D (x,y) position the message starts at.
 void setText(java.lang.String text)
          Change the messages text
 
Methods inherited from class espresso3d.engine.renderer.base.E3DTexturedRenderable
getKey, getTexture, getTextureDetail0, getTextureDetail1, isTextureAvailable, isTextureDetail0Available, isTextureDetail1Available, setTexture, setTextureDetail0, setTextureDetail1
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
getBlendMode, getRenderMode, initCorrectGeometryRenderer, isKeyChanged, setBlendMode, setKeyChanged, setRenderMode
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

E3DMessage

public E3DMessage(E3DEngine engine,
                  E3DViewport viewport,
                  java.lang.String text,
                  espresso3d.engine.viewport.text.E3DFont font,
                  double fontSize,
                  E3DVector2I position,
                  double life,
                  E3DVector3F color)
Create a message to be printed by the viewport printer. This defaults to be rendered blended

Parameters:
engine -
viewport -
text -
font -
fontSize -
position -
life -
color -

E3DMessage

public E3DMessage(E3DEngine engine,
                  E3DViewport viewport,
                  java.lang.String text,
                  espresso3d.engine.viewport.text.E3DFont font,
                  double fontSize,
                  E3DVector2I position,
                  double life,
                  E3DVector3F color,
                  int blendMode)
Create a message to be printed by the viewport printer.

Parameters:
engine -
viewport -
text -
font -
fontSize -
life -
color -
blendMode - Type of blending to use when rendering
Method Detail

render

public void render()
Specified by:
render in class E3DRenderable

getPositionedQuadList

public java.util.ArrayList getPositionedQuadList()
This will return an arraylist of positioned, textured quads in 3D space for the message. This is usually used internally by the font renderer only.

Returns:

getCursorPositionAfterMessage

public E3DVector2I getCursorPositionAfterMessage()
This returns the X, Y coords of the cursor after the last character in the message. This is useful for creating another message that will start directly after the current message for things like a change in colors.

Returns:

getFont

public espresso3d.engine.viewport.text.E3DFont getFont()
Return the font object the message is bound to


setFont

public void setFont(espresso3d.engine.viewport.text.E3DFont font)
Change the font object the message should use

Parameters:
font -

getLife

public double getLife()
Get the life of the message, or, how many seconds it will be rendered in the engine. -1 is infinity.

Returns:

getText

public java.lang.String getText()
Get the text of the message that will be rendered in the viewport.

Returns:

setText

public void setText(java.lang.String text)
Change the messages text

Parameters:
text -

getAge

public double getAge()
Return the age, or, how long the message has been rendered

Returns:

getColor

public E3DVector3F getColor()
Return the color of the message

Returns:

setColor

public void setColor(E3DVector3F color)
Set the color of the message.

Parameters:
color -

getFontSize

public double getFontSize()
Return the size of the font for the message

Returns:

setFontSize

public void setFontSize(double fontSize)
Change the size of the font the message is using. Will increase or decrease its size

Parameters:
fontSize - Size of the font (or scalar for the message)

getPosition

public E3DVector2I getPosition()
Get the 2D (x,y) position the message starts at. The position is the bottom left corner of the first character of the message and is in viewport space.

Returns:

setPosition

public void setPosition(E3DVector2I position)
Set the 2D (x,y) position the message starts at. The position is the bottom left corner of the first character of the message and is in viewport space.

Parameters:
position -