BoxRegion defines a 2D screen region. Mostly used for clipping.
Public Member Functions | |
| BoxRegion () | |
| BoxRegion (float x, float y, float width, float height) | |
| Creates a new box. More... | |
| override bool | Contains (float x, float y) |
| Checks if this box contains the given co-ordinates. More... | |
| void | Set (float x, float y, float width, float height) |
| Applies new values to an existing box. More... | |
| void | SetPoints (float minX, float minY, float maxX, float maxY) |
| void | SetPoint (float x, float y) |
| Sets this region to being the given point (with a w/h of 0). More... | |
| void | AddPoint (float x, float y) |
| Adds the given point to the region. More... | |
| void | Combine (BoxRegion r) |
| Adds the given region into this one. More... | |
| bool | Overlaps (BoxRegion box) |
| Evaluates if one box overlaps another. More... | |
| void | ClipByAffecting (BoxRegion bound, BoxRegion affect) |
| Makes sure this box fits inside the given one by clipping it so it does. Any pixels sliced off this box are also sliced off affect. More... | |
| void | ClipBy (BoxRegion box) |
| Makes sure this box fits inside the given one by clipping it so it does. More... | |
| bool | ClipByChecked (BoxRegion box) |
| Makes sure this box fits inside the given one by clipping it so it does. More... | |
| float | ClipLeft (float line) |
| Clips the left side of this box, making sure it does not extend beyond the given value. More... | |
| float | ClipRight (float line) |
| Clips the right side of this box, making sure it does not extend beyond the given value. More... | |
| float | ClipTop (float line) |
| Clips the top of this box, making sure it does not extend beyond the given value. More... | |
| float | ClipBottom (float line) |
| Clips the bottom of this box, making sure it does not extend beyond the given value. More... | |
| void | RemoveFromLeft (float px) |
| Removes up to the given amount of pixels from the left side of the box. It is bounded to ensure a negative width is not created. More... | |
| void | RemoveFromRight (float px) |
| Removes up to the given amount of pixels from the right side of the box. It is bounded to ensure a negative width is not created. More... | |
| void | RemoveFromTop (float px) |
| Removes up to the given amount of pixels from the top side of the box. It is bounded to ensure a negative height is not created. More... | |
| void | RemoveFromBottom (float px) |
| Removes up to the given amount of pixels from the bottom side of the box. It is bounded to ensure a negative height is not created. More... | |
| override string | ToString () |
| Produces an easy to read summary of this boxes shape. More... | |
Public Attributes | |
| float | X |
| The X coordinate of the box. More... | |
| float | Y |
| The Y coordinate of the box. More... | |
| float | MaxX |
| The Maximum X value of the box. X+Width. More... | |
| float | MaxY |
| The Maximum Y value of the box. Y+Height. More... | |
| float | Width |
| The width of the box. More... | |
| float | Height |
| The height of the box. More... | |
Properties | |
| static BoxRegion | Empty [get] |
| An all zero box region. More... | |
| override float | ScreenMinX [get] |
| override float | ScreenMinY [get] |
| override float | ScreenMaxX [get] |
| override float | ScreenMaxY [get] |
| bool | IsNotEmpty [get] |
| True if this region is non-zero. More... | |
| bool | IsEmpty [get] |
| True if this region is all zero. More... | |
Properties inherited from Css.ScreenRegion | |
| virtual float | ScreenMinX [get] |
| virtual float | ScreenMinY [get] |
| virtual float | ScreenMaxX [get] |
| virtual float | ScreenMaxY [get] |
|
inline |
|
inline |
Creates a new box.
| x | The X coordinate of the box. |
| y | The Y coordinate of the box. |
| width | The width of the box. |
| height | The height of the box. |
|
inline |
Adds the given point to the region.
|
inline |
Clips the bottom of this box, making sure it does not extend beyond the given value.
| line | The y coordinate of a horizontal line to clip with. It's exclusive; If it sits on the border, nothing happens. |
|
inline |
Makes sure this box fits inside the given one by clipping it so it does.
| bound | The bounding box that this must be clipped to. |
Makes sure this box fits inside the given one by clipping it so it does. Any pixels sliced off this box are also sliced off affect.
| bound | The bounding box that this must be clipped to. |
| affect | A secondary box that will also be clipped with this one. May, for example, be a region of UV pixel coordinates. |
|
inline |
Makes sure this box fits inside the given one by clipping it so it does.
| bound | The bounding box that this must be clipped to. |
|
inline |
Clips the left side of this box, making sure it does not extend beyond the given value.
| line | The x coordinate of a vertical line to clip with. It's exclusive; If it sits on the border, nothing happens. |
|
inline |
Clips the right side of this box, making sure it does not extend beyond the given value.
| line | The x coordinate of a vertical line to clip with. It's exclusive; If it sits on the border, nothing happens. |
|
inline |
Clips the top of this box, making sure it does not extend beyond the given value.
| line | The y coordinate of a horizontal line to clip with. It's exclusive; If it sits on the border, nothing happens. |
|
inline |
Adds the given region into this one.
|
inlinevirtual |
Checks if this box contains the given co-ordinates.
| x | The x coordinate to check. |
| y | The y coordinate to check. |
Reimplemented from Css.ScreenRegion.
|
inline |
Evaluates if one box overlaps another.
| box | The other box to check with. |
|
inline |
Removes up to the given amount of pixels from the bottom side of the box. It is bounded to ensure a negative height is not created.
| px | The amount of pixels to remove. |
|
inline |
Removes up to the given amount of pixels from the left side of the box. It is bounded to ensure a negative width is not created.
| px | The amount of pixels to remove. |
|
inline |
Removes up to the given amount of pixels from the right side of the box. It is bounded to ensure a negative width is not created.
| px | The amount of pixels to remove. |
|
inline |
Removes up to the given amount of pixels from the top side of the box. It is bounded to ensure a negative height is not created.
| px | The amount of pixels to remove. |
|
inline |
Applies new values to an existing box.
| x | The X coordinate of the box. |
| y | The Y coordinate of the box. |
| width | The width of the box. |
| height | The height of the box. |
|
inline |
Sets this region to being the given point (with a w/h of 0).
|
inline |
|
inline |
Produces an easy to read summary of this boxes shape.
| float Css.BoxRegion.Height |
The height of the box.
| float Css.BoxRegion.MaxX |
The Maximum X value of the box. X+Width.
| float Css.BoxRegion.MaxY |
The Maximum Y value of the box. Y+Height.
| float Css.BoxRegion.Width |
The width of the box.
| float Css.BoxRegion.X |
The X coordinate of the box.
| float Css.BoxRegion.Y |
The Y coordinate of the box.
|
staticget |
An all zero box region.
|
get |
True if this region is all zero.
|
get |
True if this region is non-zero.
|
get |
|
get |
|
get |
|
get |