Hey, I just wanted to import a few cursors, and replace my own limited handwritten image crap for lwjgl.

Now I can create ico files from gimp, but I can’t find out wich one is the right format for them (or if this even is another icon format), instead I get a crash from the loader, that kinda does not say any cause.

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck( ~[na:1.7.0_45]
	at java.util.ArrayList.get( ~[na:1.7.0_45]
	at com.jme3.cursors.plugins.CursorLoader$CursorImageData.<init>( ~[bin/:na]
	at com.jme3.cursors.plugins.CursorLoader.loadCursor( ~[bin/:na]
	at com.jme3.cursors.plugins.CursorLoader.load( ~[bin/:na]
	at com.jme3.cursors.plugins.CursorLoader.load( ~[bin/:na]
	at com.jme3.asset.DesktopAssetManager.loadAsset( ~[bin/:na]
	at com.jme3.asset.DesktopAssetManager.loadAsset( ~[bin/:na]
	at de.visiongamestudios.shared.jme.surfaces.lwjgl.LWJGLCursorProvider.setup( ~[bin/:na]
	at de.visiongamestudios.jme.VGSJMEClientApplication.initializeGame( ~[bin/:na]
	at de.visiongamestudios.jme.RendererApplication$4$ ~[bin/:na]
	at de.visiongamestudios.entitysystem.FixedRunningThreadPoolExecutor$ ~[bin/:na]

Images I use are 16x16 or 32x32. Is there anything special I need to keep in mind?

I haven’t tried .ico files for cursors. However, I’ve had some success loading .cur files.

1 Like

With what did you convert/generate them?

1 Like

generated using a Windows freeware app called RealWorld Cursor Editor:

1 Like

Well that software is gold for creating cursors, even animated ones :slight_smile: And as a plus it runs perfectly fine inside wine.

Now I’m unsure if this is a bug in the loader or I misuse the program, did you ever try to use a custom hotspot? (eg. for a picking cursor, where width/2 height/2 should be the middle point?)

I tried doing so using the cursor hot spot part, and in the preview it looks fine, the cursor is centerd where I would expect it. But after loading the hotspot is always 0,31 .
Any ideas for this, cause my first attempts to dig into the code where not that succesful :confused:


Ok this seems to be indeed an error in the loader, using the same frame two times in an .ani does seem to work tho. Feels a bit hackish however.

1 Like

I always hardcode the hotspot position in Java after loading the cursor. I don’t remember why. Maybe there’s a bug; I don’t know.

1 Like