Binding of Isaac - Afterbirth+ Lua Reference/Guide
|
The Following fonts are used by the game and can be used with the "Font()" class:
Font Name | Ingame Name/s | Ingame Example | Ingame Usage | Link to font |
---|---|---|---|---|
Droid Sans | droid | Example Droid | (Not used ingame) | Droid Sans |
PF Tempesta Seven (Condensed) | pftempestasevencondensed | Example PF Tempesta Seven | HUD Elements like coin/key counters | PF Tempesta Seven |
Team Meat Font | teammeatfont10 teammeatfont12 teammeatfont16 teammeatfont16bold | Main Menu Elements | Pop-Ups Timer / Score Elements | Team Meat Font without Bold | |
Terminus | terminus terminus8 | Debug Console / Isaac.RenderText() | Terminus | |
Upheaval | upheaval | Example Upheaval | Streak text | Upheaval |
mplus (Japanese) | mplus_10r mplus_12b | Replacement for all fonts aboth for Japanese translation. 10r is pf "Tempesta seven" / "Team Meat" replacement 12b is "Upheaval" replacement | PixelMplus (M+ Fonts) | |
kr Font (Korean) | kr_font12 kr_font14 | TBD | No source found right now | |
Team Meat Font (Korean) | kr_meatfont14 | Example kr_meatfont14 | TBD | - Not available - |
First we need to have a look at the basic process of writing on the screen. here is a sample code:
local testmod= RegisterMod( "testmod" ,1 );
local function onRender(t)
Isaac.RenderText("Sample text", 50, 30, 1, 1, 1, 255)
end
testmod:AddCallback(ModCallbacks.MC_POST_RENDER, onRender)
Result:local f = Font() -- init font object
f:Load("font/droid.fnt") -- load a font into the font object
f:DrawString("droid",60,50,KColor(1,1,1,1,0,0,0),0,true) -- render string with loaded font on position 60x50y
\197
prints:
Ä
So in order to print special characters, just replace them in the code like this:
Isaac.RenderText("S\228mple text", 50, 30, 1, 1, 1, 255)
prints:
Sämple text
The Developer _Kilburn mentioned that fonts can be created using this Tool: https://www.angelcode.com/products/bmfont.
The best results can be made by converting Bitmap fonts, since they allow for smaller fontsizes.
Font Settings:
Export Options: