Version: Unity 6.0 (6000.0)
LanguageEnglish
  • C#

RectInt.xMin

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public int xMin;

Description

The minimum x-coordinate value of the RectInt. This value is inclusive.

The RectInt.width is the difference between RectInt.xMax and xMin. If you set a xMin greater than the current RectInt.xMax, then RectInt.width becomes negative. RectInt.xMax and xMin values are normalized prior to being returned such that xMin is always the smallest of the two values and xMax the largest. For example, a RectInt r created as RectInt r = new RectInt(0, 0, 10, 10); and later assigned r.xMin = 15 returns RectInt.width of -5, RectInt.xMin of 10 and RectInt.xMax of 15. The xMin value is equal to the smallest x-coordinate contained in the RectInt. For example, a RectInt spanning x-coordinates 0–3 has an xMin of 0.