/** * {@inheritDoc} */ public void setMouseCursor(Image image, int hotSpotX, int hotSpotY) throws SlickException { try { Image temp = new Image(get2Fold(image.getWidth()), get2Fold(image.getHeight())); Graphics g = temp.getGraphics(); ByteBuffer buffer = BufferUtils.createByteBuffer(temp.getWidth() * temp.getHeight() * 4); g.drawImage(image.getFlippedCopy(false, true), 0, 0); g.flush(); g.getArea(0,0,temp.getWidth(),temp.getHeight(),buffer); Cursor cursor = CursorLoader.get().getCursor(buffer, hotSpotX, hotSpotY,temp.getWidth(),temp.getHeight()); 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.Image, int, int) */ public void setMouseCursor(Image image, int hotSpotX, int hotSpotY) throws SlickException { try { Image temp = new Image(get2Fold(image.getWidth()), get2Fold(image.getHeight())); Graphics g = temp.getGraphics(); ByteBuffer buffer = BufferUtils.createByteBuffer(temp.getWidth() * temp.getHeight() * 4); g.drawImage(image.getFlippedCopy(false, true), 0, 0); g.flush(); g.getArea(0,0,temp.getWidth(),temp.getHeight(),buffer); Cursor cursor = CursorLoader.get().getCursor(buffer, hotSpotX, hotSpotY,temp.getWidth(),image.getHeight()); Mouse.setNativeCursor(cursor); } catch (Throwable e) { Log.error("Failed to load and apply cursor.", e); throw new SlickException("Failed to set mouse cursor", e); } }
/** * {@inheritDoc} */ public void setMouseCursor(Image image, int hotSpotX, int hotSpotY) throws SlickException { try { Image temp = new Image(get2Fold(image.getWidth()), get2Fold(image.getHeight())); Graphics g = temp.getGraphics(); ByteBuffer buffer = BufferUtils.createByteBuffer(temp.getWidth() * temp.getHeight() * 4); g.drawImage(image.getFlippedCopy(false, true), 0, 0); g.flush(); g.getArea(0,0,temp.getWidth(),temp.getHeight(),buffer); Cursor cursor = CursorLoader.get().getCursor(buffer, hotSpotX, hotSpotY,temp.getWidth(),temp.getHeight()); Mouse.setNativeCursor(cursor); } catch (Exception e) { Log.error("Failed to load and apply cursor.", e); } }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.Image, int, int) */ public void setMouseCursor(Image image, int hotSpotX, int hotSpotY) throws SlickException { try { Image temp = new Image(get2Fold(image.getWidth()), get2Fold(image.getHeight())); Graphics g = temp.getGraphics(); ByteBuffer buffer = BufferUtils.createByteBuffer(temp.getWidth() * temp.getHeight() * 4); g.drawImage(image.getFlippedCopy(false, true), 0, 0); g.flush(); g.getArea(0,0,temp.getWidth(),temp.getHeight(),buffer); Cursor cursor = CursorLoader.get().getCursor(buffer, hotSpotX, hotSpotY,temp.getWidth(),image.getHeight()); Mouse.setNativeCursor(cursor); } catch (Exception e) { Log.error("Failed to load and apply cursor.", e); } }
/** * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.Image, int, int) */ public void setMouseCursor(Image image, int hotSpotX, int hotSpotY) throws SlickException { try { Image temp = new Image(get2Fold(image.getWidth()), get2Fold(image.getHeight())); Graphics g = temp.getGraphics(); ByteBuffer buffer = BufferUtils.createByteBuffer(temp.getWidth() * temp.getHeight() * 4); g.drawImage(image.getFlippedCopy(false, true), 0, 0); g.flush(); g.getArea(0,0,temp.getWidth(),temp.getHeight(),buffer); Cursor cursor = CursorLoader.get().getCursor(buffer, hotSpotX, hotSpotY,temp.getWidth(),temp.getHeight()); 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); } }
/** * @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); } }
/** * @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 (Exception e) { Log.error("Failed to load and apply 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 (Exception e) { Log.error("Failed to load and apply 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 (Exception e) { Log.error("Failed to load and apply cursor.", e); } }