Libraries.Game.Graphics.Fonts.FontDrawable Documentation

The FontDrawable class is used to maintain data about drawable font objects, including its dimensions and the drawable itself.

Example Code

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

    class Main is Game
        action Main
            StartGame()
        end

        action CreateGame
            FontDrawable letter
            letter:SetYMaximum(10)
            output letter:GetYMaximum()
        end
    end

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetDrawable()This action returns the drawable of the character.
GetHashCode()This action gets the hash code for an object.
GetHeightFromBaseline()This action returns the height from the baseline of the drawable.
GetXMaximum()This action returns the rightmost coordinate position, on the x-axis, of the drawable.
GetXMinimum()This action returns the leftmost coordinate position, on the x-axis, of the drawable.
GetYMaximum()This action returns the topmost coordinate position, on the y-axis, of the drawable.
GetYMinimum()This action returns the lowermost coordinate position, on the y-axis, of the drawable.
SetDrawable(Libraries.Game.Graphics.Drawable drawable)This action sets the drawable of the character.
SetHeightFromBaseline(integer value)This action sets the height from the baseline of the drawable.
SetXMaximum(integer xMaximum)This action sets the rightmost coordinate position, on the x-axis, of the drawable.
SetXMinimum(integer xMinimum)This action sets the leftmost coordinate position, on the x-axis, of the drawable.
SetYMaximum(integer yMaximum)This action sets the topmost coordinate position, on the y-axis, of the drawable.
SetYMinimum(integer yMinimum)This action sets the lowermost coordinate position, on the y-axis, of the drawable.

Actions Documentation

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

Return

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

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

Return

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

GetDrawable()

This action returns the drawable of the character.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                Drawable drawable = character:GetDrawable()
            end
        end

Return

Libraries.Game.Graphics.Drawable: Returns the drawable of the character.

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.

GetHeightFromBaseline()

This action returns the height from the baseline of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                output character:GetHeightFromBaseline()
            end
        end

Return

integer: Returns the height from the baseline of the drawable.

GetXMaximum()

This action returns the rightmost coordinate position, on the x-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                output character:GetXMaximum()
            end
        end

Return

integer: Returns the rightmost coordinate position of the drawable.

GetXMinimum()

This action returns the leftmost coordinate position, on the x-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                output character:GetXMinimum()
            end
        end

Return

integer: Returns the leftmost coordiate position of the drawable.

GetYMaximum()

This action returns the topmost coordinate position, on the y-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame()
                FontDrawable character
                output character:GetYMaximum()
            end
        end

Return

integer: Returns the topmost coordinate position of the drawable.

GetYMinimum()

This action returns the lowermost coordinate position, on the y-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                output character:GetYMinimum()
            end
        end

Return

integer: Returns the lowermost coordinate position of the drawable.

SetDrawable(Libraries.Game.Graphics.Drawable drawable)

This action sets the drawable of the character.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action createGame
                FontDrawable character
                Drawable drawable
                character:SetDrawable(drawable)
            end 
        end

Parameters

SetHeightFromBaseline(integer value)

This action sets the height from the baseline of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                character:SetHeightFromBaseline(10)
            end
        end

Parameters

SetXMaximum(integer xMaximum)

This action sets the rightmost coordinate position, on the x-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                character:SetXMaximum(10)
            end
        end

Parameters

SetXMinimum(integer xMinimum)

This action sets the leftmost coordinate position, on the x-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                character:SetXMinimum(10)
            end
        end

Parameters

SetYMaximum(integer yMaximum)

This action sets the topmost coordinate position, on the y-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                character:SetYMaximum(10)
            end
        end

Parameters

SetYMinimum(integer yMinimum)

This action sets the lowermost coordinate position, on the y-axis, of the drawable.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                FontDrawable character
                character:SetYMinimum(10)
            end
        end

Parameters