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

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.

Parameters

Example

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

Add(Libraries.Game.Graphics.Fonts.PixelIntersection intersection)

This action adds an x-intercept to the x-intercept array.

Parameters

Example

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

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.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

ContainsSame(Libraries.Game.Graphics.Fonts.XCoordinateList coordinateList)

This action checks whether or not the given XCoordinateList has the same items as the current XCoordinateList.

Parameters

Return

boolean: Returns true if the two lists are the same, and false if they are not.

Example

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

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

Get(integer index)

This action returns the x-intercept from the x-intercept array at the given index.

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.

Example

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

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetLast()

This action returns the last x-intercept from the x-intercept array.

Return

Libraries.Game.Graphics.Fonts.PixelIntersection: Returns the last x-intercept from the x-intercept array.

Example

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

GetList()

This action returns the list of the x-intersections for the y-coordinate position.

Return

Libraries.Containers.Array: Returns the list of the x-intersections for the y-coordinate position.

Example

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

GetNonzero()

This action returns the nonzero value of the intersection. 0 means do not draw and all other values mean draw.

Return

integer: Returns thr nonzero value of the intersection.

Example

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

GetSize()

This action returns the size of the x-intercepts array.

Return

integer: Returns the size of the x-intercepts array.

Example

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

Remove(integer position)

This action removes the x-intercept at the specified location from the x-intercept array.

Parameters

  • integer position: The position of the x-intercept to be removed from the x-intercept array.

Example

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

SetList(Libraries.Containers.Array<Libraries.Game.Graphics.Fonts.PixelIntersection> list)

This action sets the list of the x-intersections for the y-coordinate position.

Parameters

Example

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

SetNonzero(integer nonzero)

This action sets the nonzero value of the intersection. 0 means do not draw and all other values means draw.

Parameters

  • integer nonzero: The nonzero value of the intersection.

Example

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

Sort()

This action sorts the x-intercepts array in ascending order.

Example

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.

Return

text: Returns all of the x-intercepts in the x-intercepts array as text.

Example

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