Libraries.Game.Graphics.Fonts.PixelIntersection Documentation

The PixelIntersection class is used to maintain information about pixels of a glyph, including which pixels need to be turned "on" and at what intensity so as to render the glyph accurately.

Example Code

use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game

class Main is Game
    action Main
        StartGame()
    end
    
    action CreateGame
        PixelIntersection pixel
        // Indicates that the pixel at x-coordinate 0 for a given y-coordinate
        // needs to be drawn will full (1) intensity.
        pixel:SetIntensity(1)
        pixel:SetXPosition(0)
    end
end

Inherits from: Libraries.Language.Object

Actions Documentation

Compare(Libraries.Language.Object intersection)

This action checks if two PixelIntersections are the same, or if one is greater than the other.

Parameters

Return

integer: Returns whether or not the two PixelIntersections are the same, or if one is greater than the other.

Example

use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        PixelIntersection pixel
        PixelIntersection pixel2
        integer result = pixel:Compare(pixel2)
    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)

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()

GetIntensity()

This action returns the intensity of the pixel at a given x/y coordinate pair.

Return

number: Returns the intensity of the pixel at a given x/y coordinate pair.

Example

use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        PixelIntersection pixel
        output pixel:GetIntensity()
    end
end

GetXPosition()

This action gets the x-coordinate position of the pixel.

Return

integer: Returns the x-coordinate position of the pixel.

Example


    use Libraries.Game.Graphics.Fonts.all
    use Libraries.Game.Game

    class Main is Game
        action Main
            StartGame()
        end

        action CreateGame
            PixelIntersection pixel
            output pixel:GetXPosition()
        end
    end

SetIntensity(number intensity)

This action sets the intensity of the pixel at a given x/y coordinate pair.

Parameters

  • number intensity: The intensity of the pixel at a given x/y coordinate pair.

Example

use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        PixelIntersection pixel
        pixel:SetIntensity(0.5)
    end
end

SetXPosition(integer x)

This action sets the x-coordinate position of the pixel.

Parameters

  • integer x: The x-coordinate position of the pixel.

Example

use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        PixelIntersection pixel
        pixel:SetXPosition(0)
    end
end

ToText()

This action returns the x-coordinate position of the pixel as text.

Return

text: Returns the x-coordinate position of the pixel as text.

Example

use Libraries.Game.Graphics.Fonts.all
use Libraries.Game.Game

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        PixelIntersection pixel
        output pixel:ToText()
    end
end