Class Position2D
Definition
- Assembly:
- Tizen.NUI.dll
Position2D is a two-dimensional vector.
C#Copypublic class Position2D : Disposable, IDisposable, ICloneable
- Inheritance
- Implements
-
System.IDisposableSystem.ICloneable
Constructors
Declaration
C#Copypublic Position2D()
Remarks
Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting.
For example, the followings are possible.
view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost.
view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default.
Declaration
C#Copypublic Position2D(int x, int y)
Parameters
| Type | Name | Description |
|---|---|---|
| int | x | x component |
| int | y | y component |
Remarks
Position2D and Position are implicitly converted to each other, so these are compatible and can be replaced without any type casting.
For example, the followings are possible.
view.Position2D = new Position(10.0f, 10.0f, 10.0f); // be aware that here the z value(10.0f) will be lost.
view.Position = new Position2D(10, 10); // be aware that here the z value is 0.0f by default.
Declaration
C#Copypublic Position2D(Position position)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | position | Position to create this vector from |
Properties
Declaration
C#Copypublic float this[uint index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| uint | index | The subscript index. |
Property Value
| Type | Description |
|---|---|
| float | The float at the given index. |
Declaration
C#Copypublic int X { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
The setter is deprecated in API8 and will be removed in API10. Use new Position2D(...) constructor.
Declaration
C#Copypublic int Y { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
The setter is deprecated in API8 and will be removed in API10. Use new Position2D(...) constructor.
Methods
Declaration
C#Copypublic static Position2D ConvertFromString(String value)
Parameters
| Type | Name | Description |
|---|---|---|
| Tizen.System.String | value | The string to convert. |
Returns
| Type | Description |
|---|---|
| Position2D | The converted value. |
Declaration
C#Copypublic override bool Equals(Object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Tizen.System.Object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Declaration
C#Copypublic bool EqualTo(Position2D rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | rhs | The vector to compare |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the two vectors are equal, otherwise false |
Declaration
C#Copypublic override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The Hash Code. |
Overrides
Declaration
C#Copypublic bool NotEqualTo(Position2D rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | rhs | The vector to compare. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the two vectors are not equal, otherwise false. |
Operators
Declaration
C#Copypublic static Position2D operator +(Position2D arg1, Position2D arg2)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | arg1 | The vector to add. |
| Position2D | arg2 | The vector to add. |
Returns
| Type | Description |
|---|---|
| Position2D | The vector containing the result of the addition. |
Declaration
C#Copypublic static Position2D operator /(Position2D arg1, int arg2)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | arg1 | The vector to divide. |
| int | arg2 | The integer value to scale the vector by. |
Returns
| Type | Description |
|---|---|
| Position2D | The vector containing the result of the division. |
Declaration
C#Copypublic static Position2D operator /(Position2D arg1, Position2D arg2)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | arg1 | The vector to divide. |
| Position2D | arg2 | The vector to divide. |
Returns
| Type | Description |
|---|---|
| Position2D | The vector containing the result of the division. |
implicit operator Vector2(Position2D)
Converts a Position2D instance to a Vector2 instance.
Declaration
C#Copypublic static implicit operator Vector2(Position2D position2d)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | position2d | An object of the Position2D type. |
Returns
| Type | Description |
|---|---|
| Vector2 | return an object of the Vector2 type |
implicit operator Position2D(Vector2)
Converts a Vector2 instance to a Position2D instance.
Declaration
C#Copypublic static implicit operator Position2D(Vector2 vec)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | vec | An object of the Vector2 type. |
Returns
| Type | Description |
|---|---|
| Position2D | return an object of the Position2D type |
Declaration
C#Copypublic static implicit operator Position2D(String value)
Parameters
| Type | Name | Description |
|---|---|---|
| Tizen.System.String | value |
Returns
| Type | Description |
|---|---|
| Position2D |
Declaration
C#Copypublic static Position2D operator *(Position2D arg1, int arg2)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | arg1 | The vector to multiply. |
| int | arg2 | The integer value to scale the vector. |
Returns
| Type | Description |
|---|---|
| Position2D | The vector containing the result of the multiplication. |
Declaration
C#Copypublic static Position2D operator *(Position2D arg1, Position2D arg2)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | arg1 | The vector to multiply. |
| Position2D | arg2 | The vector to multiply. |
Returns
| Type | Description |
|---|---|
| Position2D | The vector containing the result of the multiplication. |
Declaration
C#Copypublic static Position2D operator -(Position2D arg1, Position2D arg2)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | arg1 | The vector to subtract. |
| Position2D | arg2 | The vector to subtract. |
Returns
| Type | Description |
|---|---|
| Position2D | The vector containing the result of the subtraction. |
Declaration
C#Copypublic static Position2D operator -(Position2D arg1)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | arg1 | The vector to negate. |
Returns
| Type | Description |
|---|---|
| Position2D | The vector containing the negation. |