Package org.newdawn.slick.geom

Examples of org.newdawn.slick.geom.Rectangle


    anim.start();
    width = 16;
    height = 16;
    maskWidth = 16;
    maskHeight = 16;
    mask = new Rectangle((float)(xPos+(width-maskWidth)/2), (float)(yPos+(height-maskHeight)/2), (float)(maskWidth), (float)maskHeight);
  }
View Full Code Here


    }
  }

 
  public void horizontalPhysics(int delta, Chunk prevChunk, Chunk currChunk, Chunk nextChunk){
    Rectangle newMask = getNextMask((float)xSpeed*delta, 0f);
    CollisionGroup sideBlocks = getSideBlocks(prevChunk, currChunk, nextChunk, newMask);
    if (xSpeed > 0){
      for (BlockMask blockMask: new BlockMask[] {sideBlocks.topRight, sideBlocks.bottomRight}){
        if (blockMask.block != null && blockMask.block.isSolid && Utils.intersects(blockMask.mask, newMask)){
          xSpeed = 0;
View Full Code Here

      }
    }
  }
 
  public void climbingPhysics(int delta, Chunk prevChunk, Chunk currChunk, Chunk nextChunk){
    Rectangle newMask = getNextMask(0f, (float)ySpeed*delta);
    CollisionGroup sideBlocks = getSideBlocks(prevChunk, currChunk, nextChunk, newMask);
    if (ySpeed > 0){
      for (BlockMask blockMask: new BlockMask[] {sideBlocks.bottomLeft, sideBlocks.bottomRight}){
        if (blockMask.block != null && blockMask.block.isSolid && Utils.intersects(blockMask.mask, newMask)){
          ySpeed = 0;
View Full Code Here

 
 
 
 
  public Rectangle getNextMask(float xs, float ys){
    return new Rectangle((float)(xPos+(width-maskWidth)/2) + xs, (float)(yPos+(height-maskHeight)/2) + ys, (float)(maskWidth), (float)maskHeight);
  }
View Full Code Here

   *            The width of the allowed area
   * @param height
   *            The height of the allowed area
   */
  public void setWorldClip(float x, float y, float width, float height) {
    worldClipRecord = new Rectangle(x, y, width, height);
    GL.glEnable(SGL.GL_CLIP_PLANE0);
    worldClip.put(1).put(0).put(0).put(-x).flip();
    GL.glClipPlane(SGL.GL_CLIP_PLANE0, worldClip);
    GL.glEnable(SGL.GL_CLIP_PLANE1);
    worldClip.put(-1).put(0).put(0).put(x + width).flip();
View Full Code Here

   *            The height of the allowed area
   */
  public void setClip(int x, int y, int width, int height) {
    predraw();
    GL.glEnable(SGL.GL_SCISSOR_TEST);
    clip = new Rectangle(x, y, width, height);
    GL.glScissor(x, screenHeight - y - height, width, height);
    postdraw();
  }
View Full Code Here

  public void fillRect(float x, float y, float width, float height,
      Image pattern, float offX, float offY) {
    int cols = ((int) Math.ceil(width / pattern.getWidth())) + 2;
    int rows = ((int) Math.ceil(height / pattern.getHeight())) + 2;

    Rectangle preClip = getWorldClip();
    setWorldClip(x, y, width, height);

    predraw();
    // Draw all the quads we need
    for (int c = 0; c < cols; c++) {
View Full Code Here

    return new Point(col * tileWidth, row * tileHeight);
  }

  public Shape getTileShape(int col, int row) {
    Point p = getTileLocation(col, row);
    return new Rectangle(p.x, p.y, tileWidth, tileHeight);
  }
View Full Code Here

      x12 = x22;
    if (y12 > y22)
      y12 = y22;
    x12 -= x1;
    y12 -= y1;
    return new Rectangle(x1, y1, (int) x12, (int) y12);
 
View Full Code Here

   * @param height
   *            The height of the area
   */
  public MouseOverArea(GUIContext container, Image image, int x, int y,
      int width, int height) {
    this(container,image,new Rectangle(x,y,width,height));
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.geom.Rectangle

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.