Package org.lwjgl.input

Examples of org.lwjgl.input.Cursor


        intbuffer.flip();
        IntBuffer intbuffer1 = GLAllocation.createDirectIntBuffer(1024);

        try
        {
            cursor = new Cursor(32, 32, 16, 16, 1, intbuffer1, intbuffer);
        }
        catch (LWJGLException lwjglexception)
        {
            lwjglexception.printStackTrace();
        }
View Full Code Here


         }

         this.particleManager = new ParticleManager(this.level, this.textureManager);
         if(this.levelLoaded) {
            try {
               var1.cursor = new Cursor(16, 16, 0, 0, 1, var9, (IntBuffer)null);
            } catch (LWJGLException var53) {
               var53.printStackTrace();
            }
         }
View Full Code Here

   
    IntBuffer buffer = getPointer(size);
   
    try {
      cursor = new Cursor(16, 16, 0, 0, 1, buffer, null);
     
    } catch (LWJGLException e) {
      e.printStackTrace();
    }
  } 
View Full Code Here

            pixelsARGBflipped[x + ((pixmap.getHeight() - 1 - y) * pixmap.getWidth())] = ((pixel & 0xFF) << 16) | ((pixel & 0xFF0000) >> 16) | (pixel & 0xFF00FF00);
          }
        }
      }

      Mouse.setNativeCursor(new Cursor(pixmap.getWidth(), pixmap.getHeight(), xHotspot, pixmap.getHeight() - yHotspot - 4, 1, IntBuffer.wrap(pixelsARGBflipped), null));
    } catch (LWJGLException e) {
      throw new GdxRuntimeException("Could not set cursor image.", e);
    }
  }
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

             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

      /**
       * @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

   * @throws SlickException Indicates a failure to load the image or a failure to create the hardware cursor
   */
  public void setAnimatedMouseCursor(String ref, int x, int y, int width, int height, int[] cursorDelays) throws SlickException
  {
    try {
      Cursor cursor;
      cursor = CursorLoader.get().getAnimatedCursor(ref, x, y, width, height, cursorDelays);
      setMouseCursor(cursor, x, y);
    } catch (IOException e) {
      throw new SlickException("Failed to set mouse cursor", e);
    } catch (LWJGLException e) {
View Full Code Here

      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

    try {
      int yspot = height - y - 1;
      if (yspot < 0) {
        yspot = 0;
      }
      return new Cursor(width,height, 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

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.