@Override public void setSystemCursor (SystemCursor systemCursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { throw new GdxRuntimeException("Couldn't set system cursor"); } }
@Override public void setCursor (com.badlogic.gdx.graphics.Cursor cursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(((LwjglCursor)cursor).lwjglCursor); } catch (LWJGLException e) { throw new GdxRuntimeException("Could not set cursor image.", e); } }
@Override public void setCursor (com.badlogic.gdx.graphics.Cursor cursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(((LwjglCursor)cursor).lwjglCursor); } catch (LWJGLException e) { throw new GdxRuntimeException("Could not set cursor image.", e); } }
@Override public void setSystemCursor (SystemCursor systemCursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { throw new GdxRuntimeException("Couldn't set system cursor"); } }
public void setNativeCursor(JmeCursor jmeCursor) { try { Cursor newCursor = null; if (jmeCursor != null) { newCursor = cursorMap.get(jmeCursor); if (newCursor == null) { newCursor = new Cursor( jmeCursor.getWidth(), jmeCursor.getHeight(), jmeCursor.getXHotSpot(), jmeCursor.getYHotSpot(), jmeCursor.getNumImages(), jmeCursor.getImagesData(), jmeCursor.getImagesDelay()); // Add to cache cursorMap.put(jmeCursor, newCursor); } } Mouse.setNativeCursor(newCursor); } catch (LWJGLException ex) { Logger.getLogger(LwjglMouseInput.class.getName()).log(Level.SEVERE, null, ex); } }
@Override public void setCursor (com.badlogic.gdx.graphics.Cursor cursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(((LwjglCursor)cursor).lwjglCursor); } catch (LWJGLException e) { throw new GdxRuntimeException("Could not set cursor image.", e); } }
@Override public void setSystemCursor (SystemCursor systemCursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { throw new GdxRuntimeException("Couldn't set system cursor"); } }
@Override public void disable() { try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { log.warning(e.getMessage()); } } }
@Override public void enable() { try { Mouse.setNativeCursor(cursor); } catch (LWJGLException e) { log.warning(e.getMessage()); } }
/** * @see org.newdawn.slick.GameContainer#setDefaultMouseCursor() */ public void setDefaultMouseCursor() { try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { Log.error("Failed to reset mouse cursor", e); } } }
@Override public void onGuiClosed() { GuiIngameForge.renderCrosshairs = true; // Enable cursor try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { VampLib.log.e("GuiPieMenu", "Could not reset cursor", e); } }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(org.lwjgl.input.Cursor, int, int) */ public void setMouseCursor(Cursor cursor, int hotSpotX, int hotSpotY) throws SlickException { try { Mouse.setNativeCursor(cursor); } catch (Throwable e) { Log.error("Failed to load and apply cursor.", e); throw new SlickException("Failed to set mouse cursor", e); } }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(org.lwjgl.input.Cursor, int, int) */ public void setMouseCursor(Cursor cursor, int hotSpotX, int hotSpotY) throws SlickException { try { Mouse.setNativeCursor(cursor); } catch (Throwable e) { Log.error("Failed to load and apply cursor.", e); throw new SlickException("Failed to set mouse cursor", e); } }
@MainThread public void setCursor(final MouseCursor cursor) { init(); try { final Cursor lwjglCursor = createLwjglCursor(cursor); if (lwjglCursor == null || !lwjglCursor.equals(Mouse.getNativeCursor())) { Mouse.setNativeCursor(lwjglCursor); } } catch (final LWJGLException e) { throw new RuntimeException("Unable to set cursor", e); } }
@Override public void initGui() { this.onGuiInit(); this.elementCount = elements.size(); radDiff = 2D * Math.PI / elementCount;// gap in rad // Disable cursor try { Mouse.setNativeCursor(new Cursor(1, 1, 0, 0, 1, BufferUtils.createIntBuffer(1), null)); } catch (LWJGLException e) { VampLib.log.e("GuiPieMenu", "Failed to set empty cursor", e); } GuiIngameForge.renderCrosshairs = false; }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(java.lang.String, int, int) */ public void setMouseCursor(String ref, int hotSpotX, int hotSpotY) throws SlickException { try { Cursor cursor = CursorLoader.get().getCursor(ref, hotSpotX, hotSpotY); Mouse.setNativeCursor(cursor); } catch (Throwable e) { Log.error("Failed to load and apply cursor.", e); throw new SlickException("Failed to set mouse cursor", e); } }
private void hideCursor() { Cursor emptyCursor; int min = org.lwjgl.input.Cursor.getMinCursorSize(); IntBuffer tmp = BufferUtils.createIntBuffer(min * min); try { emptyCursor = new org.lwjgl.input.Cursor(min, min, min / 2, min / 2, 1, tmp, null); Mouse.setNativeCursor(emptyCursor); } catch (LWJGLException e) { EditorLogger.printStackTrace(e); } }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int) */ public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException { try { Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY); Mouse.setNativeCursor(cursor); } catch (Throwable e) { Log.error("Failed to load and apply cursor.", e); throw new SlickException("Failed to set mouse cursor", e); } }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int) */ public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException { try { Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY); Mouse.setNativeCursor(cursor); } catch (Throwable e) { Log.error("Failed to load and apply cursor.", e); throw new SlickException("Failed to set mouse cursor", e); } }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(java.lang.String, * int, int) */ public void setMouseCursor(String ref, int hotSpotX, int hotSpotY) throws SlickException { try { Cursor cursor = CursorLoader.get().getCursor(ref, hotSpotX, hotSpotY); Mouse.setNativeCursor(cursor); } catch (Throwable e) { Log.error("Failed to load and apply cursor.", e); throw new SlickException("Failed to set mouse cursor", e); } }