Class QuadDimension
java.lang.Object
dev.prozilla.pine.common.math.dimension.DualDimension
dev.prozilla.pine.common.math.dimension.QuadDimension
- All Implemented Interfaces:
Cloneable<DualDimension>
,Printable
Represents four dimensions (X, Y, Z and W) for a UI element. Each dimension is defined using a
DimensionBase
.- See Also:
-
Field Summary
FieldsFields inherited from class dev.prozilla.pine.common.math.dimension.DualDimension
DEFAULT_VALUE, x, y
-
Constructor Summary
ConstructorsConstructorDescriptionCreates four default dimensions with all values set to 0 pixels.QuadDimension
(int xyzw) QuadDimension
(int xz, int yw) QuadDimension
(int x, int y, int z, int w) QuadDimension
(DimensionBase xyzw) Creates four dimensions with equal values.QuadDimension
(DimensionBase xz, DimensionBase yw) Creates four dimensions with two pairs of equal values. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a new object that is equal to this object.int
computeW
(RectTransform element) Computes the W-dimension for a given element.int
computeXZ
(RectTransform element) Computes the sum of the X- and Z-dimensions for a given element.int
computeYW
(RectTransform element) Computes the sum of the Y- and W-dimensions for a given element.int
computeZ
(RectTransform element) Computes the Z-dimension for a given element.boolean
isZero
(RectTransform element) Checks whether this pair of dimensions computes to0
for a given element.void
set
(int xyzw) void
set
(int xz, int yw) void
set
(int x, int y, int z, int w) void
set
(DimensionBase xyzw) void
set
(DimensionBase xz, DimensionBase yw) void
set
(DimensionBase x, DimensionBase y, DimensionBase z, DimensionBase w) toString()
Returns a string representation of this object.Methods inherited from class dev.prozilla.pine.common.math.dimension.DualDimension
computeX, computeY, equals, equals, fullscreen, parentHeight, parentSize, parentWidth, parse, reset, set, set, zero
-
Field Details
-
z
-
w
-
-
Constructor Details
-
QuadDimension
public QuadDimension()Creates four default dimensions with all values set to 0 pixels. -
QuadDimension
public QuadDimension(int xyzw) -
QuadDimension
Creates four dimensions with equal values. -
QuadDimension
public QuadDimension(int xz, int yw) -
QuadDimension
Creates four dimensions with two pairs of equal values. The X- and Z-dimensions and the Y- and W-dimensions will respectively be assigned equal values. -
QuadDimension
public QuadDimension(int x, int y, int z, int w) -
QuadDimension
-
-
Method Details
-
set
public void set(int xyzw) - Overrides:
set
in classDualDimension
-
set
- Overrides:
set
in classDualDimension
-
set
public void set(int xz, int yw) - Overrides:
set
in classDualDimension
-
set
- Overrides:
set
in classDualDimension
-
set
public void set(int x, int y, int z, int w) -
set
-
computeZ
Computes the Z-dimension for a given element. -
computeW
Computes the W-dimension for a given element. -
computeXZ
Computes the sum of the X- and Z-dimensions for a given element. -
computeYW
Computes the sum of the Y- and W-dimensions for a given element. -
isZero
Description copied from class:DualDimension
Checks whether this pair of dimensions computes to0
for a given element.- Overrides:
isZero
in classDualDimension
-
clone
Description copied from interface:Cloneable
Returns a new object that is equal to this object.- Specified by:
clone
in interfaceCloneable<DualDimension>
- Overrides:
clone
in classDualDimension
- Returns:
- Clone of this object
-
toString
Description copied from interface:Printable
Returns a string representation of this object.- Specified by:
toString
in interfacePrintable
- Overrides:
toString
in classDualDimension
- Returns:
- String representation of this object.
-