Libraries.Game.Graphics.Fonts.XCoordinateList Documentation
The XCoordinateList class is used to maintain x-intercepts of a glyph's outline for a given y-coordinate position. For every y-coordinate that has a line intersecting the glyph outline, there will be a corresponding XCoordinateList containing every point at which the line passes through the outline.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
PixelIntersection intersection
intersection:SetXPosition(0)
list:Add(intersection)
end
end
Inherits from: Libraries.Language.Object
Summary
Actions Summary Table
Actions | Description |
---|---|
Add(integer position, Libraries.Game.Graphics.Fonts.PixelIntersection intersection) | This action adds an x-intercept to the x-intercept array at the specified location. |
Add(Libraries.Game.Graphics.Fonts.PixelIntersection intersection) | This action adds an x-intercept to the x-intercept array. |
Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |
ContainsSame(Libraries.Game.Graphics.Fonts.XCoordinateList coordinateList) | This action checks whether or not the given XCoordinateList has the same items as the current XCoordinateList. |
Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |
Get(integer index) | This action returns the x-intercept from the x-intercept array at the given index. |
GetHashCode() | This action gets the hash code for an object. |
GetLast() | This action returns the last x-intercept from the x-intercept array. |
GetList() | This action returns the list of the x-intersections for the y-coordinate position. |
GetNonzero() | This action returns the nonzero value of the intersection. |
GetSize() | This action returns the size of the x-intercepts array. |
Remove(integer position) | This action removes the x-intercept at the specified location from the x-intercept array. |
SetList(Libraries.Containers.Array<Libraries.Game.Graphics.Fonts.PixelIntersection> list) | This action sets the list of the x-intersections for the y-coordinate position. |
SetNonzero(integer nonzero) | This action sets the nonzero value of the intersection. |
Sort() | This action sorts the x-intercepts array in ascending order. |
ToText() | This action returns all of the x-intercepts in the x-intercepts array as text. |
Actions Documentation
Add(integer position, Libraries.Game.Graphics.Fonts.PixelIntersection intersection)
This action adds an x-intercept to the x-intercept array at the specified location.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
PixelIntersection intersection
intersection:SetXPosition(0)
list:Add(0, intersection)
end
end
Parameters
- integer position: The index location to add the x-intercept to.
- Libraries.Game.Graphics.Fonts.PixelIntersection: The x-intercept to add to the x-intercept array.
Add(Libraries.Game.Graphics.Fonts.PixelIntersection intersection)
This action adds an x-intercept to the x-intercept array.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
PixelIntersection intersection
intersection:SetXPosition(0)
list:Add(intersection)
end
end
Parameters
- Libraries.Game.Graphics.Fonts.PixelIntersection: The x-intercept the add to the x-intercept array.
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.
ContainsSame(Libraries.Game.Graphics.Fonts.XCoordinateList coordinateList)
This action checks whether or not the given XCoordinateList has the same items as the current XCoordinateList.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
XCoordinateList list2
output list:ContainsSame(list2)
end
end
Parameters
- Libraries.Game.Graphics.Fonts.XCoordinateList: The XCoordinateList to check the elements of.
Return
boolean: Returns true if the two lists are the same, and false if they are not.
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.
Get(integer index)
This action returns the x-intercept from the x-intercept array at the given index.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
PixelIntersection intersection
intersection = list:Get(0)
end
end
Parameters
- integer index: The index of where to retrieve the x-intercept from the array.
Return
Libraries.Game.Graphics.Fonts.PixelIntersection: Returns the x-intercept from the x-intercept array at the given location.
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.
GetLast()
This action returns the last x-intercept from the x-intercept array.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
PixelIntersection intersection
intersection = list:GetLast()
end
end
Return
Libraries.Game.Graphics.Fonts.PixelIntersection: Returns the last x-intercept from the x-intercept array.
GetList()
This action returns the list of the x-intersections for the y-coordinate position.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
Array<PixelIntersection> items
items = list:GetList()
end
end
Return
Libraries.Containers.Array: Returns the list of the x-intersections for the y-coordinate position.
GetNonzero()
This action returns the nonzero value of the intersection. 0 means do not draw and all other values mean draw.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
output list:GetNonzero()
end
end
Return
integer: Returns thr nonzero value of the intersection.
GetSize()
This action returns the size of the x-intercepts array.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
output list:GetSize()
end
end
Return
integer: Returns the size of the x-intercepts array.
Remove(integer position)
This action removes the x-intercept at the specified location from the x-intercept array.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
list:Remove(0)
end
end
Parameters
- integer position: The position of the x-intercept to be removed from the x-intercept array.
SetList(Libraries.Containers.Array<Libraries.Game.Graphics.Fonts.PixelIntersection> list)
This action sets the list of the x-intersections for the y-coordinate position.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
PixelIntersection intersection
Array<PixelIntersection> items
intersection:SetXPosition(0)
items:Add(intersection)
list:SetList(items)
end
end
Parameters
- Libraries.Containers.Array: The list of x-intersections for the y-coordinate position.
SetNonzero(integer nonzero)
This action sets the nonzero value of the intersection. 0 means do not draw and all other values means draw.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
list:SetNonzero(0)
end
end
Parameters
- integer nonzero: The nonzero value of the intersection.
Sort()
This action sorts the x-intercepts array in ascending order.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
list:Sort()
end
end
ToText()
This action returns all of the x-intercepts in the x-intercepts array as text.
Example Code
use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game
use Libraries.Containers.Array
class Main is Game
action Main
StartGame()
end
action CreateGame
XCoordinateList list
output list:ToText()
end
end
Return
text: Returns all of the x-intercepts in the x-intercepts array as text.