Package org.lwjgl.input

Examples of org.lwjgl.input.Cursor


    try {
      int yspot = imageData.getHeight() - y - 1;
      if (yspot < 0) {
        yspot = 0;
      }
      return new Cursor(imageData.getTexWidth(), imageData.getTexHeight(), x, yspot, 1, buf.asIntBuffer(), null);
    } catch (Throwable e) {
      Log.info("Chances are you cursor is too small for this platform");
      throw new LWJGLException(e);
    }
  }
View Full Code Here


    cursorDelaysBuffer.flip();

    LoadableImageData imageData = new TGAImageData();
    ByteBuffer buf = imageData.loadImage(ResourceLoader.getResourceAsStream(ref), false, null);
         
    return new Cursor(width, height, x, y, cursorDelays.length, buf.asIntBuffer(), cursorDelaysBuffer);
  }
View Full Code Here

  /**
   * @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);
    }
View Full Code Here

  /**
   * @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);
    }
View Full Code Here

      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);
    }
View Full Code Here

      }
    }
   
    scratch.rewind();
   
    return new Cursor(w, h, x, y, 1, scratch.asIntBuffer(), null);
  }
View Full Code Here

TOP

Related Classes of org.lwjgl.input.Cursor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.