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

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.

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)

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)

GetDrawable()

This action returns the drawable of the character.

Return

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

Example

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

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

GetHeightFromBaseline()

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

Return

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

Example

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

GetXMaximum()

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

Return

integer: Returns the rightmost coordinate position of the drawable.

Example

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

GetXMinimum()

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

Return

integer: Returns the leftmost coordiate position of the drawable.

Example

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

GetYMaximum()

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

Return

integer: Returns the topmost coordinate position of the drawable.

Example

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

GetYMinimum()

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

Return

integer: Returns the lowermost coordinate position of the drawable.

Example

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

SetDrawable(Libraries.Game.Graphics.Drawable drawable)

This action sets the drawable of the character.

Parameters

Example


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

SetHeightFromBaseline(integer value)

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

Parameters

  • integer value

Example

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

SetXMaximum(integer xMaximum)

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

Parameters

  • integer xMaximum: The rightmost coordinate position of the drawable.

Example

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

SetXMinimum(integer xMinimum)

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

Parameters

  • integer xMinimum: The leftmost coordinate position of the drawable.

Example

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

SetYMaximum(integer yMaximum)

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

Parameters

  • integer yMaximum: The topmost coordinate position of the drawable.

Example

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

SetYMinimum(integer yMinimum)

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

Parameters

  • integer yMinimum: The lowermost coordinate position of the drawable.

Example

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