Android Open Source - picturepuzzle Rectangle






From Project

Back to project page picturepuzzle.

License

The source code is released under:

GNU General Public License

If you think the Android project picturepuzzle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.crr.picturepuzzle;
//from  w ww .j  a  va2  s . c  o  m

public class Rectangle {

  public int width;
  public int height;
  public float x;
  public float y;
  
  /**
   * @param width
   * @param height
   * @param x
   * @param y
   */
  public Rectangle(int x, int y, int width, int height) {
    this.width = width;
    this.height = height;
    this.x = x;
    this.y = y;
  }
  
  /**
   * Tests if the (x,y) point is inside the rectangle
   * @param x
   * @param y
   * @param rect
   * @return If (x, y) is inside rectangle
   */
  public static boolean pointIntersects(float x, float y, Rectangle rect){
    if(x >= rect.x && x <= rect.x + rect.width){
      if(y >= rect.y && y <= rect.y + rect.height){
        return true;
      }
    }
    return false;
  }
  
}




Java Source Code List

me.crr.interfaces.AABB.java
me.crr.interfaces.InputManagerReceiver.java
me.crr.interfaces.RenderHost.java
me.crr.picturepuzzle.Drawable.java
me.crr.picturepuzzle.FixedArray.java
me.crr.picturepuzzle.GameActivity.java
me.crr.picturepuzzle.InputManager.java
me.crr.picturepuzzle.MainMenuActivity.java
me.crr.picturepuzzle.PicturePuzzle.java
me.crr.picturepuzzle.PieceTransitionAnimation.java
me.crr.picturepuzzle.Piece.java
me.crr.picturepuzzle.Rectangle.java
me.crr.picturepuzzle.Render.java
me.crr.picturepuzzle.StatsActivity.java
me.crr.picturepuzzle.Texture.java
me.crr.picturepuzzle.WinTime.java