Class MouseCursor
java.lang.Object
de.gurkenlabs.litiengine.graphics.MouseCursor
- All Implemented Interfaces:
IRenderable
The 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetImage()intintvoidbooleanDetermines whether the cursor is currently visible (and will thereby be rendered), by checking thevisibleflag and whether the specified cursor image is null.voidrender(Graphics2D g) Renders the visual contents of this instance onto the provided graphics context.voidvoidvoidvoidsetOffset(int x, int y) voidsetOffsetX(int cursorOffsetX) voidsetOffsetY(int cursorOffsetY) voidsetTransform(AffineTransform transform) voidsetVisible(boolean visible) void
-
Constructor Details
-
MouseCursor
public MouseCursor()Initializes a new instance of theMouseCursorclass.
-
-
Method Details
-
render
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:
-
getImage
-
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
-
set
-
set
-
setOffset
public void setOffset(int x, int y) -
setOffsetX
public void setOffsetX(int cursorOffsetX) -
setOffsetY
public void setOffsetY(int cursorOffsetY) -
setTransform
-
setVisible
public void setVisible(boolean visible) -
showDefaultCursor
public void showDefaultCursor() -
hideDefaultCursor
public void hideDefaultCursor()
-