Table of Contents

Struct NormalizedByte2

Namespace
Microsoft.Xna.Framework.Graphics.PackedVector
Assembly
MonoGame.Framework.dll

Packed vector type containing two 8-bit signed normalized values, ranging from −1 to 1.

public struct NormalizedByte2 : IPackedVector<ushort>, IPackedVector, IEquatable<NormalizedByte2>
Implements
Inherited Members

Constructors

NormalizedByte2(Vector2)

Initializes a new instance of this structure.

public NormalizedByte2(Vector2 vector)

Parameters

vector Vector2

A Vector2 value who's components contain the initial values for this structure.

NormalizedByte2(float, float)

Initializes a new instance of this structure.

public NormalizedByte2(float x, float y)

Parameters

x float

The initial x-component value for this structure.

y float

The initial y-component value for this structure.

Properties

PackedValue

Directly gets or sets the packed representation of the value.

public ushort PackedValue { get; set; }

Property Value

ushort

Methods

Equals(NormalizedByte2)

public bool Equals(NormalizedByte2 other)

Parameters

other NormalizedByte2

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

ToVector2()

Expands the packed representation to a Vector2.

public Vector2 ToVector2()

Returns

Vector2

The expanded value.

ToVector4()

Expands the packed representation into a Vector4.

public Vector4 ToVector4()

Returns

Vector4

The expanded Vector4.

Operators

operator ==(NormalizedByte2, NormalizedByte2)

Returns a value that indicates whether the two values are equal.

public static bool operator ==(NormalizedByte2 a, NormalizedByte2 b)

Parameters

a NormalizedByte2

The value on the left of the equality operator.

b NormalizedByte2

The value on the right of the equality operator.

Returns

bool

true if the two values are equal; otherwise, false.

operator !=(NormalizedByte2, NormalizedByte2)

Returns a value that indicates whether the two value are not equal.

public static bool operator !=(NormalizedByte2 a, NormalizedByte2 b)

Parameters

a NormalizedByte2

The value on the left of the inequality operator.

b NormalizedByte2

The value on the right of the inequality operator.

Returns

bool

true if the two value are not equal; otherwise, false.