Package tripleplay.ui.util
Class BoxPoint
java.lang.Object
tripleplay.ui.util.BoxPoint
Defines a point relative to a box.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BoxPoint
The bottom left corner.static final BoxPoint
The bottom right corner.static final BoxPoint
The center of the box.final float
Normalized x, y coordinates.final float
Normalized x, y coordinates.final float
Absolute x, y offsets.final float
Absolute x, y offsets.static final BoxPoint
The top left corner.static final BoxPoint
The top right corner. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionalign
(Style.HAlign halign, Style.VAlign valign) Creates a new box point that is equivalent to this one except with the given horizontal and vertical alignment.bottom()
Creates a new box point that is equivalent to this one except with a y coordinate that will resolve to the top bottom of the box.center()
Creates a new box point that is equivalent to this one except with x, y coordinates that will resolve to the center of the box.halign
(Style.HAlign halign) Creates a new box point that is equivalent to this one except with the given x alignment.left()
Creates a new box point that is equivalent to this one except with an x coordinate that will resolve to the left edge of the box.nx
(float nx) Creates a new box point that is equivalent to this one except with the given normalized x coordinate.ny
(float ny) Creates a new box point that is equivalent to this one except with the given normalized y coordinate.offset
(float x, float y) Creates a new box point that is equivalent to this one except with given offset coordinates.pythagoras.f.Point
resolve
(float x, float y, float width, float height, pythagoras.f.Point dest) Finds the coordinates of the point, using the box defined by the given coordinates.pythagoras.f.Point
resolve
(pythagoras.f.IDimension size, pythagoras.f.Point dest) Finds the coordinates of the point, using the box with top left of 0, 0 and the given dimension.pythagoras.f.Point
Finds the screen coordinates of the point, using the given element as the box.right()
Creates a new box point that is equivalent to this one except with an x coordinate that will resolve to the right edge of the box.top()
Creates a new box point that is equivalent to this one except with a y coordinate that will resolve to the top edge of the box.valign
(Style.VAlign valign) Creates a new box point that is equivalent to this one except with the given y alignment.
-
Field Details
-
TL
The top left corner. -
BL
The bottom left corner. -
TR
The top right corner. -
BR
The bottom right corner. -
CENTER
The center of the box. -
nx
public final float nxNormalized x, y coordinates. For example, nx = 1 is the right edge. -
ny
public final float nyNormalized x, y coordinates. For example, nx = 1 is the right edge. -
ox
public final float oxAbsolute x, y offsets. -
oy
public final float oyAbsolute x, y offsets.
-
-
Constructor Details
-
BoxPoint
public BoxPoint(float nx, float ny) Creates a new box point that will resolve to the given normalized coordinates. -
BoxPoint
public BoxPoint(float nx, float ny, float ox, float oy) Creates a new box point that will resolve to the given normalized coordinates plus the given absolute coordinates.
-
-
Method Details
-
left
Creates a new box point that is equivalent to this one except with an x coordinate that will resolve to the left edge of the box. -
right
Creates a new box point that is equivalent to this one except with an x coordinate that will resolve to the right edge of the box. -
top
Creates a new box point that is equivalent to this one except with a y coordinate that will resolve to the top edge of the box. -
bottom
Creates a new box point that is equivalent to this one except with a y coordinate that will resolve to the top bottom of the box. -
center
Creates a new box point that is equivalent to this one except with x, y coordinates that will resolve to the center of the box. -
offset
Creates a new box point that is equivalent to this one except with given offset coordinates. -
ny
Creates a new box point that is equivalent to this one except with the given normalized y coordinate. -
align
Creates a new box point that is equivalent to this one except with the given horizontal and vertical alignment. -
valign
Creates a new box point that is equivalent to this one except with the given y alignment. This is a shortcut for callingny(float)
with 0, .5, or 1. -
nx
Creates a new box point that is equivalent to this one except with the given normalized x coordinate. -
halign
Creates a new box point that is equivalent to this one except with the given x alignment. This is a shortcut for callingnx(float)
with 0, .5, or 1. -
resolve
Finds the screen coordinates of the point, using the given element as the box. -
resolve
public pythagoras.f.Point resolve(float x, float y, float width, float height, pythagoras.f.Point dest) Finds the coordinates of the point, using the box defined by the given coordinates. -
resolve
public pythagoras.f.Point resolve(pythagoras.f.IDimension size, pythagoras.f.Point dest) Finds the coordinates of the point, using the box with top left of 0, 0 and the given dimension.
-