org.xith3d.ui.hud.utils
Class Cursor

java.lang.Object
  extended by org.xith3d.ui.hud.utils.Cursor

public class Cursor
extends java.lang.Object

The Cursor class encapsulates a Texture and zero-point-coordinates for a HUD-Cursor.


Nested Class Summary
static class Cursor.Type
           
 
Constructor Summary
Cursor(java.lang.String texture)
          Creates a new Cursor instance using the given texture resource name and default zero-point coordinates.
Cursor(java.lang.String texture, int zeroX, int zeroY)
          Creates a new Cursor instance using the given texture resource name and zero-point coordinates.
Cursor(java.lang.String texture, org.openmali.vecmath2.Tuple2i zeroPoint)
          Creates a new Cursor instance using the given texture resource name and zero-point coordinates.
Cursor(Texture2D texture)
          Creates a new Cursor instance using the given texture and default zero-point coordinates.
Cursor(Texture2D texture, int zeroX, int zeroY)
          Creates a new Cursor instance using the given texture and zero-point coordinates.
Cursor(Texture2D texture, org.openmali.vecmath2.Tuple2i zeroPoint)
          Creates a new Cursor instance using the given texture and zero-point coordinates.
 
Method Summary
 Texture2D getTexture()
          Returns this cursor's texture.
 org.openmali.vecmath2.Point2i getZeroPoint()
          Returns this cursor's zero-point cursor-local pixel coordinates.
 int getZeroPointX()
          Returns the x-coordinate of this cursor's zero-point cursor-local pixel coordinates.
 int getZeroPointY()
          Returns the y-coordinate of this cursor's zero-point cursor-local pixel coordinates.
 void setTexture(java.lang.String texture)
          Sets this cursor's texture.
 void setTexture(Texture2D texture)
          Sets this cursor's texture.
 void setZeroPoint(int zeroPointX, int zeroPointY)
          Sets this cursor's zero-point cursor-local pixel coordinates.
 void setZeroPoint(org.openmali.vecmath2.Tuple2i zeroPoint)
          Sets this cursor's zero-point cursor-local pixel coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cursor

public Cursor(Texture2D texture,
              int zeroX,
              int zeroY)
Creates a new Cursor instance using the given texture and zero-point coordinates.

Parameters:
texture - org.xith3d.scenegraph.Texture2D - the texture to use
zeroX - int - the x-coordinate of this cursor's zero-point
zeroY - int - the y-coordinate of this cursor's zero-point

Cursor

public Cursor(Texture2D texture,
              org.openmali.vecmath2.Tuple2i zeroPoint)
Creates a new Cursor instance using the given texture and zero-point coordinates.

Parameters:
texture - org.xith3d.scenegraph.Texture2D - the texture to use
zeroPoint - org.openmali.vecmath2.Tuple2i - the zero-point coordinates to use

Cursor

public Cursor(Texture2D texture)
Creates a new Cursor instance using the given texture and default zero-point coordinates.

Parameters:
texture - org.xith3d.scenegraph.Texture2D - the texture to use

Cursor

public Cursor(java.lang.String texture,
              int zeroX,
              int zeroY)
Creates a new Cursor instance using the given texture resource name and zero-point coordinates.

Parameters:
texture - java.lang.String - the texture to use
zeroX - int - the x-coordinate of this cursor's zero-point
zeroY - int - the y-coordinate of this cursor's zero-point

Cursor

public Cursor(java.lang.String texture,
              org.openmali.vecmath2.Tuple2i zeroPoint)
Creates a new Cursor instance using the given texture resource name and zero-point coordinates.

Parameters:
texture - java.lang.String - the texture to use
zeroPoint - org.openmali.vecmath2.Tuple2i - the zero-point coordinates to use

Cursor

public Cursor(java.lang.String texture)
Creates a new Cursor instance using the given texture resource name and default zero-point coordinates.

Parameters:
texture - java.lang.String - the texture to use
Method Detail

setTexture

public final void setTexture(Texture2D texture)
Sets this cursor's texture.

Parameters:
texture - org.xith3d.scenegraph.Texture2D - the texture to set

setTexture

public final void setTexture(java.lang.String texture)
Sets this cursor's texture.

Parameters:
texture - java.lang.String - the name of the texture to set

getTexture

public final Texture2D getTexture()
Returns this cursor's texture.

Returns:
org.xith3d.scenegraph.Texture2D - the texture to return

setZeroPoint

public final void setZeroPoint(int zeroPointX,
                               int zeroPointY)
Sets this cursor's zero-point cursor-local pixel coordinates.

Parameters:
zeroPointX - int - x-coordinate of the cursor's zero-point
zeroPointY - int - y-coordinate of the cursor's zero-point

setZeroPoint

public final void setZeroPoint(org.openmali.vecmath2.Tuple2i zeroPoint)
Sets this cursor's zero-point cursor-local pixel coordinates.

Parameters:
zeroPoint - org.openmali.vecmath2.Tuple2i - the coordinates to set

getZeroPoint

public final org.openmali.vecmath2.Point2i getZeroPoint()
Returns this cursor's zero-point cursor-local pixel coordinates.

Returns:
org.openmali.vecmath2.Point2i - this cursor's zero-point cursor-local pixel coordinates

getZeroPointX

public final int getZeroPointX()
Returns the x-coordinate of this cursor's zero-point cursor-local pixel coordinates.

Returns:
int - the x-coordinate

getZeroPointY

public final int getZeroPointY()
Returns the y-coordinate of this cursor's zero-point cursor-local pixel coordinates.

Returns:
int - the y-coordinate