Package com.jme3.cursors.plugins
Class JmeCursor
java.lang.Object
com.jme3.cursors.plugins.JmeCursor
A Jme representation of the LWJGL Cursor class.
Created Jun 6, 2012 12:12:38 PM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Queries the cursor's height.Queries the cursor's images' data.Queries the cursor's delay for each frame.int
Queries the number of images contained in the cursor.int
getWidth()
Queries the cursor's width.int
Queries the cursor's X hotspot coordinate.int
Queries the cursor's Y hotspot coordinate.void
setHeight
(int height) Sets the cursor's height.void
setImagesData
(IntBuffer imagesData) Sets the cursor's image(s) data.void
setImagesDelay
(IntBuffer imagesDelay) Sets the cursor image delay for each frame of an animated cursor.void
setNumImages
(int numImages) Sets the number of images in the cursor.void
setWidth
(int width) Sets the cursor's width.void
setxHotSpot
(int xHotSpot) Sets the cursor's X coordinate for its hotspot.void
setyHotSpot
(int yHotSpot) Sets the cursor's Y axis coordinate for its hotspot.
-
Constructor Details
-
JmeCursor
public JmeCursor()
-
-
Method Details
-
getHeight
public int getHeight()Queries the cursor's height. Note that the coordinate system is the same as OpenGL. 0, 0 being lower left.- Returns:
- the height in pixel.
-
getImagesData
Queries the cursor's images' data.- Returns:
- An
IntBuffer
containing the cursor's image(s) data in sequence.
-
getImagesDelay
Queries the cursor's delay for each frame.- Returns:
- An
IntBuffer
containing the cursor's delay in sequence. The delay is expressed in milliseconds.
-
getNumImages
public int getNumImages()Queries the number of images contained in the cursor. Static cursors should contain only 1 image.- Returns:
- The number of image(s) composing the cursor. 1 if the cursor is static.
-
getWidth
public int getWidth()Queries the cursor's width. Note that the coordinate system is the same as OpenGL. 0, 0 being lower left.- Returns:
- the width of the cursor in pixel.
-
getXHotSpot
public int getXHotSpot()Queries the cursor's X hotspot coordinate. Note that the coordinate system is the same as OpenGL. 0, 0 being lower left.- Returns:
- the coordinate on the cursor's X axis where the hotspot is located.
-
getYHotSpot
public int getYHotSpot()Queries the cursor's Y hotspot coordinate. Note that the coordinate system is the same as OpenGL. 0, 0 being lower left.- Returns:
- the coordinate on the cursor's Y axis where the hotspot is located.
-
setHeight
public void setHeight(int height) Sets the cursor's height.- Parameters:
height
- The height of the cursor in pixels. Note that all images in a cursor have to be the same size.
-
setImagesData
Sets the cursor's image(s) data. Each image data should be consecutively stored in theIntBuffer
if more tha one image is contained in the cursor.- Parameters:
imagesData
- the cursor's image(s) data. Each image data should be consecutively stored in theIntBuffer
if more than one image is contained in the cursor.
-
setImagesDelay
Sets the cursor image delay for each frame of an animated cursor. If the cursor has no animation and consist of only 1 image, null is expected.- Parameters:
imagesDelay
- the desired delay amount for each frame
-
setNumImages
public void setNumImages(int numImages) Sets the number of images in the cursor.- Parameters:
numImages
- number of images in the cursor.
-
setWidth
public void setWidth(int width) Sets the cursor's width.- Parameters:
width
- The width of the cursor in pixels. Note that all images in a cursor have to be the same size.
-
setxHotSpot
public void setxHotSpot(int xHotSpot) Sets the cursor's X coordinate for its hotspot.- Parameters:
xHotSpot
- the cursor's X axis coordinate for its hotspot. Note that the coordinate system is the same as OpenGL. 0, 0 being lower left.
-
setyHotSpot
public void setyHotSpot(int yHotSpot) Sets the cursor's Y axis coordinate for its hotspot.- Parameters:
yHotSpot
- the cursor's Y axis coordinate for its hotspot. Note that the coordinate system is the same as OpenGL. 0, 0 being lower left.
-