Type:Rect: Difference between revisions

From Resonite Wiki
imported>DoubleStyx
mNo edit summary
 
cat and remove unnecessary paragraphs
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{| class="wikitable"
'''Rect''' is a [[Value Type|value type]] that represents a 2-dimensional rectangle. It consists of an x and y coordinate along with a width and height. Most components will interpret these values as proportions of the total bounds, i.e. between 0 and 1.
|-
| Color
| Type
|-
| style="background-color:{{Rect-color}}" |
| Rect
|}


[[Category:Types]]
== Examples ==
A '''Rect''' represents a 2-dimensional rectangle. It consists of a starting x and y coordinate, and a width and length. Most, if not all, components will have these as proportions of the total bounds, between 0 and 1. For example, for the [[SpriteProvider (Component)|SpriteProvider]] component, the Rect property bounds the sprite to be rendered, with the values being proportions of the total width and height of the sprite image.


For dynamic variables and other components requiring a type, the type for Rect is <tt>BaseX.Rect</tt>.
* For the [[SpriteProvider (Component)|SpriteProvider]] component, the Rect property bounds the sprite to be rendered, with the values being proportions of the total width and height of the sprite image.
* Rects can be received from the component [[Component:RectTransformComputedProperties|RectTransformComputedProperties]] to get the elements inside a UIX Canvas, and the rect sizes and positions from those elements.
 
[[Category:Type]]
[[Category:Value types]]

Latest revision as of 18:35, 14 October 2025

Rect is a value type that represents a 2-dimensional rectangle. It consists of an x and y coordinate along with a width and height. Most components will interpret these values as proportions of the total bounds, i.e. between 0 and 1.

Examples

  • For the SpriteProvider component, the Rect property bounds the sprite to be rendered, with the values being proportions of the total width and height of the sprite image.
  • Rects can be received from the component RectTransformComputedProperties to get the elements inside a UIX Canvas, and the rect sizes and positions from those elements.