Class MouseCursor

java.lang.Object
de.gurkenlabs.litiengine.graphics.MouseCursor
All Implemented Interfaces:
IRenderable

public final class MouseCursor
extends java.lang.Object
implements IRenderable
The visual representation of the Mouse in the LITIENGINE.
It controls the appearance of the rendered cursor and allows to specify offsets from the actual mouse location.
See Also:
Mouse
  • Constructor Summary

    Constructors 
    ConstructorDescription
    MouseCursor()
    Initializes a new instance of the MouseCursor class.
  • Method Summary

    Modifier and TypeMethodDescription
    java.awt.ImagegetImage() 
    intgetOffsetX() 
    intgetOffsetY() 
    java.awt.geom.AffineTransformgetTransform() 
    voidhideDefaultCursor() 
    booleanisVisible()
    Determines whether the cursor is currently visible (and will thereby be rendered), by checking the visible flag and whether the specified cursor image is null.
    voidrender​(java.awt.Graphics2D g)
    Renders the visual contents of this instance onto the provided graphics context.
    voidset​(java.awt.Image img) 
    voidset​(java.awt.Image img, int offsetX, int offsetY) 
    voidset​(java.awt.Image img, Align hAlign, Valign vAlign) 
    voidsetOffset​(int x, int y) 
    voidsetOffsetX​(int cursorOffsetX) 
    voidsetOffsetY​(int cursorOffsetY) 
    voidsetTransform​(java.awt.geom.AffineTransform transform) 
    voidsetVisible​(boolean visible) 
    voidshowDefaultCursor() 

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MouseCursor

      public MouseCursor()
      Initializes a new instance of the MouseCursor class.
  • Method Details

    • render

      public void render​(java.awt.Graphics2D g)
      Description copied from interface: IRenderable
      Renders the visual contents of this instance onto the provided graphics context.

      If an Entity implements this interface, this method will be called right after the entity was rendered from the environment. Allowing for a custom rendering mechanism.

      This interface can be implemented in general by anything that should be rendered to the game's screen.

      Specified by:
      render in interface IRenderable
      Parameters:
      g - The current graphics object onto which this instance will render its visual contents.
      See Also:
      RenderEngine.renderEntity(Graphics2D, de.gurkenlabs.litiengine.entities.IEntity)
    • getImage

      public java.awt.Image getImage()
    • getTransform

      public java.awt.geom.AffineTransform getTransform()
    • getOffsetX

      public int getOffsetX()
    • getOffsetY

      public int getOffsetY()
    • isVisible

      public boolean isVisible()
      Determines whether the cursor is currently visible (and will thereby be rendered), by checking the visible flag and whether the specified cursor image is null.
      Returns:
      True if the cursor is currently visible; otherwise false.
    • set

      public void set​(java.awt.Image img)
    • set

      public void set​(java.awt.Image img, int offsetX, int offsetY)
    • set

      public void set​(java.awt.Image img, Align hAlign, Valign vAlign)
    • setOffset

      public void setOffset​(int x, int y)
    • setOffsetX

      public void setOffsetX​(int cursorOffsetX)
    • setOffsetY

      public void setOffsetY​(int cursorOffsetY)
    • setTransform

      public void setTransform​(java.awt.geom.AffineTransform transform)
    • setVisible

      public void setVisible​(boolean visible)
    • showDefaultCursor

      public void showDefaultCursor()
    • hideDefaultCursor

      public void hideDefaultCursor()