MutableBox
-
android
class MutableBox : Box
A mutable axis-aligned rectangle. See ImmutableBox for an immutable version.
Note that unlike android.graphics.RectF, this does not express an opinion about axis direction (e.g. the positive Y axis being "down"), because it is intended to be used with any coordinate system rather than just Android screen/View space.
Summary
Public constructors |
|
|---|---|
|
Constructs a |
android
|
Public functions |
||
|---|---|---|
open operator Boolean |
android
|
|
open Int |
hashCode() |
android
|
MutableBox |
populateFrom(input: Box)Fills this |
android
|
MutableBox |
populateFromCenterAndDimensions(Constructs a |
android
|
MutableBox |
populateFromTwoPoints(point1: Vec, point2: Vec)Constructs the smallest |
android
|
MutableBox |
setXBounds(x1: Float, x2: Float)Sets the lower and upper bounds in the |
android
|
MutableBox |
setYBounds(y1: Float, y2: Float)Sets the lower and upper bounds in the |
android
|
open String |
toString() |
android
|
Public properties |
||
|---|---|---|
open Float |
The upper bound in the |
android
|
open Float |
The lower bound in the |
android
|
open Float |
The upper bound in the |
android
|
open Float |
The lower bound in the |
android
|
Inherited functions |
|||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited properties |
|---|
Public constructors
MutableBox
MutableBox()
Constructs a MutableBox without any initial data. Fill with the appropriate setters or factory functions.
Public functions
populateFrom
fun populateFrom(input: Box): MutableBox
Fills this MutableBox with the same values contained in input.
populateFromCenterAndDimensions
fun populateFromCenterAndDimensions(
center: Vec,
width: @FloatRange(from = 0.0) Float,
height: @FloatRange(from = 0.0) Float
): MutableBox
Constructs a MutableBox with a given center, width, and height. width and height must be non-negative numbers.
populateFromTwoPoints
fun populateFromTwoPoints(point1: Vec, point2: Vec): MutableBox
Constructs the smallest MutableBox containing the two given points.
setXBounds
fun setXBounds(x1: Float, x2: Float): MutableBox
Sets the lower and upper bounds in the X direction to new values. The minimum value becomes xMin, and the maximum value becomes xMax. Returns the same instance to chain function calls.
setYBounds
fun setYBounds(y1: Float, y2: Float): MutableBox
Sets the lower and upper bounds in the Y direction to new values. The minimum value becomes yMin, and the maximum value becomes yMax. Returns the same instance to chain function calls.