Binding of Isaac - Afterbirth+ Lua Reference/Guide
|
Public Member Functions | |
Font (void) | |
boolean | Load (string FilePath) |
Unload () | |
boolean | IsLoaded () |
DrawString (string String, float PositionX, float PositionY, KColor RenderColor, unsigned int BoxWidth, boolean Center) | |
DrawStringScaled (string String, float PositionX, float PositionY, float ScaleX, float ScaleY, KColor RenderColor, unsigned int BoxWidth, boolean Center) | |
Converts UTF8 to UTF16, then draws. More... | |
DrawStringUTF8 (string String, float PositionX, float PositionY, KColor RenderColor, unsigned int BoxWidth, boolean Center) | |
Unicode. More... | |
DrawStringScaledUTF8 (string String, float PositionX, float PositionY, float ScaleX, float ScaleY, KColor RenderColor, unsigned int BoxWidth, boolean Center) | |
Unicode. More... | |
unsigned int | GetCharacterWidth (char Character) |
unsigned int | GetBaselineHeight () |
unsigned int | GetLineHeight () |
unsigned int | GetStringWidth (string String) |
unsigned int | GetStringWidthUTF8 (string String) |
Unicode. More... | |
SetMissingCharacter (u16 MissingCharacter) | |
Font::Font | ( | void | ) |
Constructor for the "Font" class.
local f = Font() -- init font object
f:Load("font/terminus.fnt") -- load a font into the font object
f:DrawString("Hello World!",60,50,KColor(1,1,1,1),0,true) -- render string with loaded font on position 60x50y
Font::DrawString | ( | string | String, |
float | PositionX, | ||
float | PositionY, | ||
KColor | RenderColor, | ||
unsigned int | BoxWidth, | ||
boolean | Center | ||
) |
Draws a string of text to the screen
Converts UTF8 to UTF16, then draws the string.
Notes: The BoxWidth and Center parameters can be used for aligning the text: If BoxWidth is zero, the text will be left aligned and the center parameter will be ignored If BoxWidth is NOT zero, and the Center parameter is FALSE, then the text will be right aligned inside the BoxWidth size If BoxWidth is NOT zero, and the center parameter is TRUE, then the text will be centered inside the BoxWidth size
local f = Font() -- init font object
f:Load("font/terminus.fnt") -- load a font into the font object
f:DrawString("Hello World!",60,50,KColor(1,1,1,1),0,true) -- render string with loaded font on position 60x50y
Font::DrawStringScaled | ( | string | String, |
float | PositionX, | ||
float | PositionY, | ||
float | ScaleX, | ||
float | ScaleY, | ||
KColor | RenderColor, | ||
unsigned int | BoxWidth, | ||
boolean | Center | ||
) |
Draws a scaled string of text on the screen.
Converts UTF8 to UTF16, then draws the string.
local f = Font() -- init font object
f:Load("font/terminus.fnt") -- load a font into the font object
f:DrawStringScaled("Hello World!",60,50,0.5,0.5,KColor(1,1,1,1),0,true) -- render string with loaded font on position 60x50y
Font::DrawStringScaledUTF8 | ( | string | String, |
float | PositionX, | ||
float | PositionY, | ||
float | ScaleX, | ||
float | ScaleY, | ||
KColor | RenderColor, | ||
unsigned int | BoxWidth, | ||
boolean | Center | ||
) |
Draws a scaled string of Unicode text on the screen.
local f = Font() -- init font object
f:Load("font/terminus.fnt") -- load a font into the font object
f:DrawStringScaledUTF8("Hello World!",60,50,0.5,0.5,KColor(1,1,1,1),0,true) -- render string with loaded font on position 60x50y
Font::DrawStringUTF8 | ( | string | String, |
float | PositionX, | ||
float | PositionY, | ||
KColor | RenderColor, | ||
unsigned int | BoxWidth, | ||
boolean | Center | ||
) |
Draws a string of Unicode text to the screen
Notes: The BoxWidth and Center parameters can be used for aligning the text: If BoxWidth is zero, the text will be left aligned and the center parameter will be ignored If BoxWidth is NOT zero, and the Center parameter is FALSE, then the text will be right aligned inside the BoxWidth size If BoxWidth is NOT zero, and the center parameter is TRUE, then the text will be centered inside the BoxWidth size
local f = Font() -- init font object
f:Load("font/terminus.fnt") -- load a font into the font object
f:DrawStringUTF8("Hello World!",60,50,KColor(1,1,1,1),0,true) -- render string with loaded font on position 60x50y
unsigned int Font::GetBaselineHeight | ( | ) |
Get the number of pixels from the absolute top of the line to the base of the characters
unsigned int Font::GetCharacterWidth | ( | char | Character | ) |
Returns the width of a specific character
unsigned int Font::GetLineHeight | ( | ) |
Get the distance in pixels between each line of text
unsigned int Font::GetStringWidth | ( | string | String | ) |
Converts UTF8 to UTF16 and returns string width
unsigned int Font::GetStringWidthUTF8 | ( | string | String | ) |
returns string width of a Unicode text.
boolean Font::IsLoaded | ( | ) |
Returns whether a font is loaded or not.
boolean Font::Load | ( | string | FilePath | ) |
Loads a font.
local f = Font() -- init font object
f:Load("font/terminus.fnt") -- load a font into the font object
f:DrawString("Hello World!",60,50,KColor(1,1,1,1),0,true) -- render string with loaded font on position 60x50y
Font::SetMissingCharacter | ( | u16 | MissingCharacter | ) |
Converts UTF8 to UTF16, then draws
Sets the missing character to be used by the font (the character used when missing characters are encountered)
Font::Unload | ( | ) |
Unloads all our data from memory