Creates a new Box object with the top-left-front corner specified by the
x
, y
and z
parameters and with the
specified width
, height
and depth
parameters. If you call this public without parameters, a box with
x
, y
, z
, width
,
height
and depth
properties set to 0 is created.
The x coordinate of the top-left-front corner of the box.
The y coordinate of the top-left-front corner of the box.
The z coordinate of the top-left-front corner of the box.
The width of the box, in pixels.
The height of the box, in pixels.
The depth of the box, in pixels.
The deoth of the box, in pixels. Changing the depth
value
of a Box object has no effect on the x
, y
,
z
, width
and height
properties.
The height of the box, in pixels. Changing the height
value
of a Box object has no effect on the x
, y
,
z
, depth
and width
properties.
The width of the box, in pixels. Changing the width
value
of a Box object has no effect on the x
, y
,
z
, depth
and height
properties.
The x coordinate of the top-left-front corner of the box.
Changing the value of the x
property of a Box object has no
effect on the y
, z
, width
,
height
and depth
properties.
The value of the x
property is equal to the value of the
left
property.
The y coordinate of the top-left-front corner of the box.
Changing the value of the y
property of a Box object has no
effect on the x
, z
, width
,
height
and depth
properties.
The value of the y
property is equal to the value of the
top
property.
The y coordinate of the top-left-front corner of the box.
Changing the value of the z
property of a Box object has no
effect on the x
, y
, width
,
height
and depth
properties.
The value of the z
property is equal to the value of the
front
property.
The sum of the z
and height
properties.
The sum of the z
and height
properties.
The sum of the y
and height
properties.
The sum of the y
and height
properties.
The location of the Box object's bottom-right corner, determined by the
values of the right
and bottom
properties.
The z coordinate of the top-left-front corner of the box. Changing
the front
property of a Box object has no effect on the
x
, y
, width
and height
properties. However it does affect the depth
property,
whereas changing the z
value does not affect the
depth
property.
The value of the left
property is equal to the value of
the x
property.
The z coordinate of the top-left-front corner of the box. Changing
the front
property of a Box object has no effect on the
x
, y
, width
and height
properties. However it does affect the depth
property,
whereas changing the z
value does not affect the
depth
property.
The value of the left
property is equal to the value of
the x
property.
The x coordinate of the top-left corner of the box. Changing the
left
property of a Box object has no effect on the
y
and height
properties. However it does affect
the width
property, whereas changing the x
value
does not affect the width
property.
The value of the left
property is equal to the value of
the x
property.
The x coordinate of the top-left corner of the box. Changing the
left
property of a Box object has no effect on the
y
and height
properties. However it does affect
the width
property, whereas changing the x
value
does not affect the width
property.
The value of the left
property is equal to the value of
the x
property.
The sum of the x
and width
properties.
The sum of the x
and width
properties.
The size of the Box object, expressed as a Vector3D object with the
values of the width
, height
and
depth
properties.
The y coordinate of the top-left-front corner of the box. Changing
the top
property of a Box object has no effect on the
x
and width
properties. However it does affect
the height
property, whereas changing the y
value does not affect the height
property.
The value of the top
property is equal to the value of the
y
property.
The y coordinate of the top-left-front corner of the box. Changing
the top
property of a Box object has no effect on the
x
and width
properties. However it does affect
the height
property, whereas changing the y
value does not affect the height
property.
The value of the top
property is equal to the value of the
y
property.
The location of the Box object's top-left-front corner, determined by the x, y and z coordinates of the point.
Returns a new Box object with the same values for the x
,
y
, z
, width
, height
and depth
properties as the original Box object.
A new Box object with the same values for the x
,
y
, z
, width
,
height
and depth
properties as the
original Box object.
Finds the closest point on the Box to another given point. This can be used for maximum error calculations for content within a given Box.
The point for which to find the closest point on the Box
An optional Vector3D to store the result to prevent creating a new object.
Determines whether the specified position is contained within the cubic region defined by this Box object.
The x coordinate(horizontal component) of the position.
The y coordinate(vertical component) of the position.
The z coordinate(longitudinal component) of the position.
A value of true
if the Box object contains the
specified position; otherwise false
.
Determines whether the Box object specified by the box
parameter is contained within this Box object. A Box object is said to
contain another if the second Box object falls entirely within the
boundaries of the first.
The Box object being checked.
A value of true
if the Box object that you specify
is contained by this Box object; otherwise false
.
Determines whether the specified position is contained within the cubic
region defined by this Box object. This method is similar to the
Box.contains()
method, except that it takes a Vector3D
object as a parameter.
The position, as represented by its x, y and z coordinates.
A value of true
if the Box object contains the
specified position; otherwise false
.
Copies all of box data from the source Box object into the calling Box object.
The Box object from which to copy the data.
Determines whether the object specified in the toCompare
parameter is equal to this Box object. This method compares the
x
, y
, z
, width
,
height
and depth
properties of an object against
the same properties of this Box object.
The box to compare to this Box object.
A value of true
if the object has exactly the same
values for the x
, y
, z
,
width
, height
and depth
properties as this Box object; otherwise false
.
Increases the size of the Box object by the specified amounts, in
pixels. The center point of the Box object stays the same, and its
size increases to the left and right by the dx
value, to
the top and the bottom by the dy
value, and to
the front and the back by the dz
value.
The value to be added to the left and the right of the Box object. The following equation is used to calculate the new width and position of the box:
The value to be added to the top and the bottom of the Box object. The following equation is used to calculate the new height and position of the box:
The value to be added to the front and the back of the Box object. The following equation is used to calculate the new depth and position of the box:
Increases the size of the Box object. This method is similar to the
Box.inflate()
method except it takes a Vector3D object as
a parameter.
The following two code examples give the same result:
The x
property of this Vector3D object is used to
increase the horizontal dimension of the Box object.
The y
property is used to increase the vertical
dimension of the Box object.
The z
property is used to increase the
longitudinal dimension of the Box object.
If the Box object specified in the toIntersect
parameter
intersects with this Box object, returns the area of intersection
as a Box object. If the boxes do not intersect, this method returns an
empty Box object with its properties set to 0.
The Box object to compare against to see if it intersects with this Box object.
A Box object that equals the area of intersection. If the
boxes do not intersect, this method returns an empty Box
object; that is, a box with its x
, y
,
z
, width
, height
, and
depth
properties set to 0.
Determines whether the object specified in the toIntersect
parameter intersects with this Box object. This method checks the
x
, y
, z
, width
,
height
, and depth
properties of the specified
Box object to see if it intersects with this Box object.
The Box object to compare against this Box object.
A value of true
if the specified object intersects
with this Box object; otherwise false
.
Determines whether or not this Box object is empty.
A value of true
if the Box object's width, height or
depth is less than or equal to 0; otherwise false
.
Adjusts the location of the Box object, as determined by its top-left-front corner, by the specified amounts.
Moves the x value of the Box object by this amount.
Moves the y value of the Box object by this amount.
Moves the z value of the Box object by this amount.
Adjusts the location of the Box object using a Vector3D object as a
parameter. This method is similar to the Box.offset()
method, except that it takes a Vector3D object as a parameter.
A Vector3D object to use to offset this Box object.
Sets all of the Box object's properties to 0. A Box object is empty if its width, height or depth is less than or equal to 0.
This method sets the values of the x
, y
,
z
, width
, height
, and
depth
properties to 0.
Sets the members of Box to the specified values
The x coordinate of the top-left-front corner of the box.
The y coordinate of the top-left-front corner of the box.
The width of the box, in pixels.
The height of the box, in pixels.
The depth of the box, in pixels.
Builds and returns a string that lists the horizontal, vertical and longitudinal positions and the width, height and depth of the Box object.
A string listing the value of each of the following properties of
the Box object: x
, y
, z
,
width
, height
, and depth
.
Adds two boxes together to create a new Box object, by filling in the horizontal, vertical and longitudinal space between the two boxes.
Note: The union()
method ignores boxes with
0
as the height, width or depth value, such as: var
box2:Box = new Box(300,300,300,50,50,0);
A new Box object that is the union of the two boxes.
Generated using TypeDoc
A Box object is an area defined by its position, as indicated by its top-left-front corner point(x, y, z) and by its width, height and depth.
The
x
,y
,z
,width
,height
depth
properties of the Box export class are independent of each other; changing the value of one property has no effect on the others. However, theright
,bottom
andback
properties are integrally related to those six properties. For example, if you change the value of theright
property, the value of thewidth
property changes; if you change thebottom
property, the value of theheight
property changes.The following methods and properties use Box objects:
bounds
property of the DisplayObject classYou can use the
new Box()
constructor to create a Box object.Note: The Box export class does not define a cubic Shape display object.