loadBitmapFontFromSprite(sprite: string, chars: string): Asset<BitmapFontData>

Define the frames of an existing sprite as characters that can be used as a font. This was primarily intended for use with loadSpriteAtlas because the sprite in question usually isn't the whole image and so can't be also passed to loadBitmapFont as its own font. This waits for the sprite to load before doing anything, but if the sprite doesn't load, the game will transition to the error screen after a timeout (which is set by ).

paramsprite- The ID of the sprite to use as a font. Must already have frames defined

paramchars- The characters that correspond to each of the frames in the sprite. You can't use space or newline here because those are hard-coded to special behaviors in the text layout code.

returnsThe generated font data.

groupAssets

see

kaplay logo

Misc

Layer