Struct Position
A 3D location in the world.
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: AGS.API.dll
Syntax
[DataContract]
public struct Position : IEquatable<Position>
Constructors
|
Improve this Doc
View Source
Position(PointF, Nullable<Single>)
Declaration
public Position(PointF point, float? z = default(float? ))
Parameters
Type |
Name |
Description |
PointF |
point |
|
System.Nullable<System.Single> |
z |
|
|
Improve this Doc
View Source
Position(Single, Single, Nullable<Single>)
Declaration
[JsonConstructor]
public Position(float x, float y, float? z = default(float? ))
Parameters
Type |
Name |
Description |
System.Single |
x |
|
System.Single |
y |
|
System.Nullable<System.Single> |
z |
|
Fields
|
Improve this Doc
View Source
Empty
Declaration
public static Position Empty
Field Value
Properties
|
Improve this Doc
View Source
X
Declaration
[DataMember(Name = "X")]
public float X { get; }
Property Value
Type |
Description |
System.Single |
The x.
|
|
Improve this Doc
View Source
XY
Gets the (x,y) as a point.
Declaration
public PointF XY { get; }
Property Value
Type |
Description |
PointF |
The xy.
|
|
Improve this Doc
View Source
Y
Declaration
[DataMember(Name = "Y")]
public float Y { get; }
Property Value
Type |
Description |
System.Single |
The y.
|
|
Improve this Doc
View Source
Z
Gets the z coordinate.
In a 2D world, Z is actually used to decide what gets rendered behind what.
By default, Z will equal Y and will change whenever Y changes, so that characters/objects which are
more to the bottom of the screen will appear in the front, which is the desired behavior in most scenarios.
By setting a location with Z different than Y, this behavior breaks, making Z an independent value (this can
be reverted again by explicitly setting Z to be Y).
Declaration
[DataMember(Name = "Z")]
public float Z { get; }
Property Value
Type |
Description |
System.Single |
The z.
|
Methods
|
Improve this Doc
View Source
Deconstruct(out Single, out Single, out Single)
Deconstruct the specified x, y and z (can be used for tuple deconstruction).
Declaration
public void Deconstruct(out float x, out float y, out float z)
Parameters
Type |
Name |
Description |
System.Single |
x |
The x coordinate.
|
System.Single |
y |
The y coordinate.
|
System.Single |
z |
The z coordinate.
|
|
Improve this Doc
View Source
Equals(Position)
Declaration
public bool Equals(Position other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
ToString()
Returns a System.String that represents the current Position.
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
A System.String that represents the current Position.
|
Overrides
System.ValueType.ToString()
Operators
|
Improve this Doc
View Source
Implicit((Single x, Single y, Nullable<Single> z) to Position)
Declaration
public static implicit operator Position((float x, float y, float? z) pos)
Parameters
Type |
Name |
Description |
System.ValueTuple<System.Single, System.Single, System.Nullable<System.Single>> |
pos |
|
Returns
|
Improve this Doc
View Source
Implicit((Single x, Single y) to Position)
Declaration
public static implicit operator Position((float x, float y) pos)
Parameters
Type |
Name |
Description |
System.ValueTuple<System.Single, System.Single> |
pos |
|
Returns
Implements
System.IEquatable<T>