Version 0.2.0
LÖVE Documentation
OverviewLicenceCreditsGetting started
Devices
love.objectslove.graphicslove.audiolove.keyboardlove.mouselove.filesystemlove.timer
Types
AnimationColorFontImageMusicSound
Callbacks
loadupdatedrawmousepressedmousereleasedkeypressedkeyreleased
Miscellaneous
ConstantsConfig filesKeyboard shortcuts
Function
love.objects:newImageFont( filename, glyphs )
An image font is created by having a series of characters set next to each other in a horizontal row. Between all the characters and on the left and right sides should be a dividing line consisting of a single color (which is not found in the actual characters themselves).
This example image is consiting of black and white glyphs on a pink background (background can be transparent) where they are separated by yellow lines. The yellow will be used in determining where each character begins and ends.
Usage
love.objects:newImageFont( filename, glyphs )
Arguments
filenameThe filepath to the image file.
glyphsA list of the characters as they are in the image.
Returns
FontA Font object containing the font data.
Examples
Example 1: Add the example font. example = love.objects:newImageFont("imagefont.png", " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&`'*#=[]"");