Custom Mouse Cursor

Since it’s complaining that your buffer is too small you could always try increasing the buffer size to see what happens.

My recollection is that windows cursors have to be a specific size or sizes. I could be remember incorrectly, either way the error seems to say a lot about your buffer size.

This was the brokeness, it didn’t give any error and worked on Linux:

Windows cursors need to be a derivative of 8 - off the top of my head they are: so 8, 16, 32, 48, 64, 96, 128 - and they must be the same size both horizontally and vertically.

FrozenShader option worked for me. Was choosing a texture with a wrong size.

I said that it needs 50x50 on the very begining of my post :slight_smile:
As far as I remember the standard size 48x48 refused to work, it was broken like in tonihele’s screen, and the ‘magic 50’ is some dirty hack.

Well, worked for one. Now i’ve tested with another file .png with transparent background and he adds a white background around the image itself :frowning:

Any possible solution?

You did something wrong. My code is working with transparency channel in .png images. Are you loading .png file into texture directly using asset manager?

Texture tex = _manager.loadTexture("Ico/cursor.png");

I have this function:

private void UpdateCursor() {
Texture tex = assetManager.loadTexture("Interface/Cursors/mouse2.png");
inputManager.setMouseCursor(textureToCursor(tex));
}

UpdateCursor is called on simpleInitApp.

Here’s the icons:

Imgur
Imgur

The 1st one, (the hand), works fine. The other one adds a white line around it.

Thanks for help

I have no idea what can be wrong…

You tested it? Also happened the same thing?

Yes, I have the same. I’ll try to solve it in free time.