Class MouseCursor
java.lang.Object
de.gurkenlabs.litiengine.graphics.MouseCursor
- All Implemented Interfaces:
IRenderable
public final class MouseCursor
extends java.lang.Object
implements IRenderableThe visual representation of the
It controls the appearance of the rendered cursor and allows to specify offsets from the actual mouse location.
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 Constructor Description MouseCursor()Initializes a new instance of theMouseCursorclass.Method Summary
Modifier and Type Method Description 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 thevisibleflag 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()
Constructor Details
MouseCursor
public MouseCursor()Initializes a new instance of theMouseCursorclass.
Method Details
render
public void render(java.awt.Graphics2D g)Description copied from interface:IRenderableRenders the visual contents of this instance onto the provided graphics context.If an
Entityimplements 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:
renderin interfaceIRenderable- 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 thevisibleflag 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
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()
