FREE TRIAL

|

☀
☾
struct

Length2

A 2D Length or a Length Pair.

Remarks

X and First read from and write to the same location in memory, as do Y and Second. This makes them interchangable and subject to user preference or context.

Fields

First

The first component of this Length Pair.

Second

The second component of this Length Pair.

X

The X-axis component of this 2D Length.

Y

The Y-axis component of this 2D Length.

Static Fields

One

A fixed Length2 set to One along along all dimensions.

Zero

A fixed Length2 set to Zero along all dimensions.

Properties

Item[int]

Access each component by axis index.

Percent

get: If Type == Percent, returns Raw. Otherwise returns float.NaN.
set: Assigns Raw to the provided float value and assigns Type to Percent.

1 == 100%.

Raw

The numeric values associated with this Length2.

Type

The type of each Length. Tells the system how to interpret Raw per component.

Value

get: If Type == Value, returns Raw. Otherwise returns float.NaN.
set: Assigns Raw to the provided float value and assigns Type to Value.

Static Methods

FixedValue (2 overloads)
  1. Create a new Value Length2 from x and y.
  2. Create a new Value Length2.
Percentage (2 overloads)
  1. Create a new Percent Length2 from x and y.
  2. Create a new Percent Length2.

Constructors

Length2(Length, Length)

Constructs a new Length2.

Operators

Division(Length2, float)

Division operator, divides lhs by rhs.

Division(Length2, Vector2)

Division operator, divides lhs by rhs component-wise.

Division(float, Length2)

Division operator, divides lhs by rhs.

Division(Vector2, Length2)

Division operator, divides lhs by rhs component-wise.

Implicit(Length to Length2)

Constructs a new Length2 and assigns each component to length.

Implicit(Vector2 to Length2)

Converts a UnityEngine.Vector2, v, into a Value Length2.

Multiply(Length2, float)

Multiplication operator, scales lhs by rhs.

Multiply(Length2, Vector2)

Multiplication operator, scales lhs by rhs component-wise.

Multiply(float, Length2)

Multiplication operator, scales rhs by lhs.

Multiply(Vector2, Length2)

Multiplication operator, scales rhs by lhs component-wise.

UnaryNegation(Length2)

Numeric negation operator, multiplies rhs by -1.

☀
☾
In This Article
Legal EmailContact Github
Copyright © 2022 Supernova Technologies, LLC