本文整理匯總了Java中com.badlogic.gdx.graphics.g2d.BitmapFont.BitmapFontData方法的典型用法代碼示例。如果您正苦於以下問題:Java BitmapFont.BitmapFontData方法的具體用法?Java BitmapFont.BitmapFontData怎麽用?Java BitmapFont.BitmapFontData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.graphics.g2d.BitmapFont
的用法示例。
在下文中一共展示了BitmapFont.BitmapFontData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: writeFont
import com.badlogic.gdx.graphics.g2d.BitmapFont; //導入方法依賴的package包/類
/** A utility method which writes the given font data to a file.
*
* The specified pixmaps are written to the parent directory of <tt>outFntFile</tt>, using that file's name without an
* extension for the PNG file name(s).
*
* The specified FontInfo is optional, and can be null.
*
* Typical usage looks like this:
*
* <pre>
* BitmapFontWriter.writeFont(myFontData, myFontPixmaps, Gdx.files.external("fonts/output.fnt"), new FontInfo("Arial", 16));
* </pre>
*
* @param fontData the font data
* @param pages the pixmaps to write as PNGs
* @param outFntFile the output file for the font definition
* @param info the optional font info for the header file, can be null */
public static void writeFont (BitmapFont.BitmapFontData fontData, Pixmap[] pages, FileHandle outFntFile, FontInfo info) {
String[] pageRefs = writePixmaps(pages, outFntFile.parent(), outFntFile.nameWithoutExtension());
//write the font data
writeFont(fontData, pageRefs, outFntFile, info, pages[0].getWidth(), pages[0].getHeight());
}