Custom Mouse Cursor from PNG

I saw that but the early examples in the thread seemed out-of-sync with what’s currently in Jme3 and the later examples seem to require .cur/.ico/.ani files.

Anyway, a bit of guesswork based on the first post brings me to this, which worked - thanks:

[java] Texture cursorTexture = assetManager.loadTexture(“Textures/cursors/point.png”);

    Image image = cursorTexture.getImage();
    ByteBuffer imgByteBuff = image.getData(0);
    imgByteBuff.rewind();
    IntBuffer imgIntBuff = imgByteBuff.asIntBuffer();
    
    JmeCursor c = new JmeCursor();
    c.setHeight(image.getHeight());
    c.setWidth(image.getWidth());
    c.setNumImages(1);
    c.setyHotSpot(image.getHeight()-3);
    c.setxHotSpot(3);
    c.setImagesData(imgIntBuff);
    
    inputManager.setMouseCursor(c);[/java]