Package it.polimi.ingsw.client.new_gui
Class GUI.Rectangle
java.lang.Object
it.polimi.ingsw.client.new_gui.GUI.Rectangle
- Enclosing class:
GUI
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double absX, double absY) voidfitImageViewToThis(javafx.scene.image.ImageView imgView) intgetX(double xPercentage) intgetY(double yPercentage) relativeToThis(double _relX, double _relY, double _relW, double _relH) squareFromHeightRelativeToThis(double _relX, double _relY, double _relH) squareFromWidthRelativeToThis(double _relX, double _relY, double _relW) javafx.scene.shape.RectangletoString()
-
Field Details
-
relX
public final double relX -
relY
public final double relY -
relW
public final double relW -
relH
public final double relH
-
-
Constructor Details
-
Rectangle
public Rectangle(double relX, double relY, double relW, double relH)
-
-
Method Details
-
contains
public boolean contains(double absX, double absY) -
sameToTheRight
-
getX
public int getX(double xPercentage) - Parameters:
xPercentage- x-position relative to the rectangle- Returns:
- absolute x-position
-
getY
public int getY(double yPercentage) - Parameters:
yPercentage- y-position relative to the rectangle- Returns:
- absolute y-position
-
relativeToThis
- Returns:
- a rectangle with coordinates expressed in a system relative to this rectangle
-
squareFromWidthRelativeToThis
-
squareFromHeightRelativeToThis
-
fitImageViewToThis
public void fitImageViewToThis(javafx.scene.image.ImageView imgView) -
toJavaFXRect
public javafx.scene.shape.Rectangle toJavaFXRect() -
toString
-