Instant properties: y
The instant property y corresponds to the y coordinate stored in a point or rect operand.
Declaration
Form 1:
int32 point.y
Form 2:
int32 rect.y
Discussion
In its first form, the read access to this property returns the y coordinate of a point operand. The write access modifies the y coordinate of a point operand. The value of the x coordinate is not affected by the modification. For example:
var point p = <100,200>; // Read the y coordinate var int32 result = p.y; // result = 200 // Modify the y coordinate p.y = 250; // p = <100,250>
In its second form, the read access to this property returns the y coordinate of the origin of a rect operand (means the y coordinate of the rectangle's top-left corner). The write access modifies the y coordinate of a rect operand causing the rectangle to change its vertical position. The values of other coordinates as well as the size of the rectangle are not affected by the modification. For example:
var rect r = <100,200,150,300>; // Read the y coordinate var int32 result = r.y; // result = 200 // Modify the y coordinate r.y = 50; // r = <100,50,150,150>
Usage in Inspector
When working with Inspector you can easily access, evaluate and modify the y coordinate. For this purpose select in Inspector the desired point property or attribute and click on the small triangle on its left side to expand and display the subordinated values:
Similarly when you have expanded a rect property or attribute you can conveniently inspect and modify the rect's origin position: