Type:Rect: Difference between revisions

From Resonite Wiki
imported>DoubleStyx
mNo edit summary
 
m a edit that shows that a person is a NERD who wants to manually do a type themselves
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{| class="wikitable"
A '''Rect''' represents a [[Value Type|value type]] of a 2-dimensional rectangle. It consists of a starting x and y coordinate, and a width and height. Most, if not all, components will have these as proportions of the total bounds, between 0 and 1.
|-
| Color
| Type
|-
| style="background-color:{{Rect-color}}" |
| Rect
|}


[[Category:Types]]
For dynamic variables and other components requiring a type, the type for Rect is <code>rect</code> or the non-pretty named type <code>Elements.Core.Rect</code>.
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>.
== Examples ==
* 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.
 
== See Also ==
 
=== How Other Places Define Rects ===
* Unity's documentation on [https://docs.unity3d.com/ScriptReference/Rect.html Rects] & [https://docs.unity3d.com/ScriptReference/RectTransform.html RectTransforms]
* Wikipedia's definition on the [https://en.wikipedia.org/wiki/Rectangle rectangle]
* Microsoft's documentation on [https://learn.microsoft.com/en-us/dotnet/api/system.windows.rect?view=windowsdesktop-8.0 Rect Struct]
 
[[Category:Type]]

Latest revision as of 08:19, 30 June 2024

A Rect represents a value type of a 2-dimensional rectangle. It consists of a starting x and y coordinate, and a width and height. Most, if not all, components will have these as proportions of the total bounds, between 0 and 1.

For dynamic variables and other components requiring a type, the type for Rect is rect or the non-pretty named type Elements.Core.Rect.

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.

See Also

How Other Places Define Rects