private void initialize() { if (cursorLocation == null) { cursor = GlobalResources.linkCursor; } else { cursor = new Pixmap(Gdx.files.internal(cursorLocation)); } listeners = new DelayedRemovalArray<EventListener>(); this.addListener(new EventListener() { @Override public boolean handle(Event event) { if (event instanceof InputEvent) { Type type = ((InputEvent) event).getType(); if (type == Type.enter) { if (!me.isDisabled()) Gdx.graphics.setCursor(Gdx.graphics.newCursor(cursor, 4, 0)); return true; } else if (type == Type.exit) { Gdx.graphics.setSystemCursor(SystemCursor.Arrow); return true; } } return false; } }); }
private void initialize() { this.addListener(new EventListener() { @Override public boolean handle(Event event) { if (event instanceof InputEvent) { Type type = ((InputEvent) event).getType(); if (type == Type.enter) { if (!me.isDisabled()) Gdx.graphics.setCursor(Gdx.graphics.newCursor(cursor != null ? cursor : GlobalResources.linkCursor, 4, 0)); return true; } else if (type == Type.exit) { Gdx.graphics.setSystemCursor(SystemCursor.Arrow); return true; } } return false; } }); }
private void initialize() { this.addListener(new EventListener() { @Override public boolean handle(Event event) { if (event instanceof InputEvent) { Type type = ((InputEvent) event).getType(); // Click if (type == Type.touchUp && ((InputEvent) event).getButton() == Buttons.LEFT) { Gdx.net.openURI(linkURL); } else if (type == Type.enter) { Gdx.graphics.setCursor(Gdx.graphics.newCursor(GlobalResources.linkCursor, 4, 0)); } else if (type == Type.exit) { Gdx.graphics.setSystemCursor(SystemCursor.Arrow); } return true; } return false; } }); }
@Override protected void accept() { // Update setting for (Button b : cbs) { if (b.isChecked()) { GlobalConf.data.CATALOG_JSON_FILE = candidates.get(b); break; } } // No change to execute exit event, manually restore cursor to default Gdx.graphics.setSystemCursor(SystemCursor.Arrow); // Data load can start EventManager.instance.post(Events.LOAD_DATA_CMD); }
@Override public void setSystemCursor(SystemCursor systemCursor) { // TODO Auto-generated method stub }
@Override public void exit(InputEvent event, float x, float y, int pointer, Actor toActor) { Gdx.graphics.setSystemCursor(SystemCursor.Arrow); }
@Override public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor) { Gdx.graphics.setSystemCursor(SystemCursor.Ibeam); }
@Override public void setSystemCursor (SystemCursor systemCursor) { }
/** * Resets the cursor image to the default one. * * @see SystemCursor#Arrow */ public void resetCursorImage() { Gdx.graphics.setSystemCursor(Cursor.SystemCursor.Arrow); }