libgdx - using system cursor

Hi,

I am trying to use the change the system cursor but for some reason it keeps using the default arrow cursor.
any idea what I am missing?
I tried this in version libgdx 1.9.5 and in version 1.6.5.


public class CursorTest extends ApplicationAdapter {
	SpriteBatch batch;
	Texture img;
	
	@Override
	public void create () {
		batch = new SpriteBatch();
		img = new Texture("badlogic.jpg");
		Gdx.graphics.setSystemCursor(Cursor.SystemCursor.VerticalResize);
	}

	@Override
	public void render () {
		Gdx.gl.glClearColor(1, 0, 0, 1);
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
		batch.begin();
		batch.draw(img, 0, 0);
		batch.end();
	}
	
	@Override
	public void dispose () {
		batch.dispose();
		img.dispose();
	}
}


The release notes of version 1.8.0 contain this:

Maybe It has something to do with the backend. if so, how do I know what backend libgdx is using?

Try this,


Pixmap pixmap = new Pixmap(Gdx.files.internal("path_to_your_cursor.png"));
Gdx.graphics.setCursor(Gdx.graphics.newCursor(pixmap, 0, 0));

it works with Gdx 1.7.1

He wants to use the system cursor, not make his own.

EDIT: Found your problem


Gdx.graphics.setSystemCursor(Cursor.SystemCursor.VerticalResize);

When you probably copypasted this line, you didn’t change the [icode]Cursor.SystemCursor.VerticalResize[/icode].

Gdx.graphics.setSystemCursor(Cursor.SystemCursor.VerticalResize);

If I use this I get the default arrow, but it should be a vertical line with two arrows.
I also tried the others like:


Gdx.graphics.setSystemCursor(Cursor.SystemCursor.Crosshair);

or

Gdx.graphics.setSystemCursor(Cursor.SystemCursor.Hand);

but I get the default arrow every time.

I had the same problem! Maybe this helps:

Thanks, but it does not seem to work.
I changed the build.gradle file but am unable to import the LwjglApplicationConfiguration to Lwjgl3ApplicationConfiguration and LwjglApplication to Lwjgl3Application.
How can I make gradle import the lwjgl?
I am using the 1.9.5 version of libgdx which is the latest version.

EDIT: I noticed there was a window in intellij informing me that the project was not linked with Gradle…
I’ve always ignored it, but linking it solved this issue.
Btw, is there any reason why the backend is not set to LWJGL3 by default?
Just curious.