Libraries.Game.Graphics.Fonts.CoordinateVector Documentation
The CoordinateVector class is used to store information about x/y coordinate pairs, including their position, whether or not they are on the curve, and if they are endpoints.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame()
CoordinateVector vector
vector:SetX(0)
vector:SetY(1)
output "x: " + vector:GetX() + ", y: " + vector:GetY()
end
end
Inherits from: Libraries.Language.Object
Summary
Actions Summary Table
Actions | Description |
---|---|
AddNewPointRelativeToLast(integer changeInX, integer changeInY, boolean onCurve, boolean endpoint) | This action changes the vector's coordinates based on the change in x and y for a given line. |
Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |
Copy(Libraries.Game.Graphics.Fonts.CoordinateVector vector) | This action makes a copy of a given vector. |
Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |
GetHashCode() | This action gets the hash code for an object. |
GetX() | This action returns the x position of the vector. |
GetY() | This action returns the y position of the vector. |
IsComputed() | This action checks whether or not this vector has had its coordinates computed. |
IsEndpoint() | This action checks whether or not this vector is an endpoint of the curve. |
IsOnCurve() | This action returns whether or not the vector is on the outline curve. |
SetComputed(boolean computed) | This action sets whether or not this vector has had its coordinates computed. |
SetEndpoint(boolean endpoint) | This action sets whether or not this vector is an endpoint of the curve. |
SetOnCurve(boolean onCurve) | This action sets whether or not this vector is on the outline curve. |
SetX(integer x) | This action sets the x position of the vector. |
SetY(integer y) | This action sets the y position of the vector. |
Actions Documentation
AddNewPointRelativeToLast(integer changeInX, integer changeInY, boolean onCurve, boolean endpoint)
This action changes the vector's coordinates based on the change in x and y for a given line.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame()
CoordinateVector vector
vector:AddNewPointRelativeToLast(1, 2, true, false)
end
end
Parameters
- integer changeInX: The rate of change along the x-axis.
- integer changeInY: The rate of change along the y-axis.
- boolean onCurve: Whether or not this point is on the curve.
Compare(Libraries.Language.Object object)
This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.
Example Code
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Copy(Libraries.Game.Graphics.Fonts.CoordinateVector vector)
This action makes a copy of a given vector.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector1
CoordinateVector vector2
vector1:SetX(1)
vector1:SetY(1)
vector2:Copy(vector1)
output vector2:GetX()
end
end
Parameters
- Libraries.Game.Graphics.Fonts.CoordinateVector: The vector to be copied.
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Example Code
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
GetHashCode()
This action gets the hash code for an object.
Example Code
Object o
integer hash = o:GetHashCode()
Return
integer: The integer hash code of the object.
GetX()
This action returns the x position of the vector.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
output vector:GetX()
end
end
Return
integer: Returns the x position of the vector.
GetY()
This action returns the y position of the vector.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
output vector:GetY()
end
end
Return
integer: Returns the y position of the vector.
IsComputed()
This action checks whether or not this vector has had its coordinates computed.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
output vector:IsComputed()
end
end
Return
boolean: Returns true if the vector has been computed, and false if it has not been.
IsEndpoint()
This action checks whether or not this vector is an endpoint of the curve.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
output vector:IsEndpoint()
end
end
Return
boolean: Returns true if the vector is an endpoint of the curve, and false if it is not.
IsOnCurve()
This action returns whether or not the vector is on the outline curve.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame()
CoordinateVector vector
output vector:IsOnCurve()
end
end
Return
boolean: Returns true if the vector is on the curve, and false if it is not.
SetComputed(boolean computed)
This action sets whether or not this vector has had its coordinates computed.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
vector:SetComputed(false)
end
end
Parameters
- boolean computed: True if the vector has been computed, and false if it has not been.
SetEndpoint(boolean endpoint)
This action sets whether or not this vector is an endpoint of the curve.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
vector:SetEndpoint(true)
end
end
Parameters
- boolean endpoint: True if the vector is an endpoint, and false if it is not.
SetOnCurve(boolean onCurve)
This action sets whether or not this vector is on the outline curve.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
vector:SetOnCurve(true)
output vector:IsOnCurve()
end
end
Parameters
- boolean onCurve: True is the vector is on the curve, false if it is not.
SetX(integer x)
This action sets the x position of the vector.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
vector:SetX(1)
output vector:GetX()
end
end
Parameters
- integer x: The x position of the vector.
SetY(integer y)
This action sets the y position of the vector.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
CoordinateVector vector
vector:SetY(1)
output vector:GetY()
end
end
Parameters
- integer y: The y position of the vector.