Java 类com.badlogic.gdx.graphics.g2d.freetype.FreetypeFontLoader 实例源码

项目:skycity    文件:Assets.java   
/**
 * 初始游戏字体
 */
private void initFont() {
    FreetypeFontLoader.FreeTypeFontLoaderParameter fontConfig = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    fontConfig.fontFileName = "font.ttf";
    fontConfig.fontParameters.size = 22;

    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("font.ttf"));
    FreeTypeFontGenerator.FreeTypeFontParameter parameters = new FreeTypeFontGenerator.FreeTypeFontParameter();

    parameters.size = 18;
    f18 = generator.generateFont(parameters);
    parameters.size = 22;
    f22 = generator.generateFont(parameters);
    parameters.size = 24;
    f24 = generator.generateFont(parameters);

    generator.dispose();
}
项目:Fruit-Destroyer    文件:Font.java   
public Font(final Application APP, String fileName, String filePath, int size, boolean filter)
{
    // ASSIGN ATTRIBUTES
    this.size = size;

    FreetypeFontLoader.FreeTypeFontLoaderParameter parameter = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    FileHandleResolver resolver = new InternalFileHandleResolver();

    APP.assets.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    APP.assets.setLoader(BitmapFont.class, ".otf", new FreetypeFontLoader(resolver));

    // GENERATE FONT
    if (filter) // IF FILTER ENABLED
    {
        parameter.fontParameters.genMipMaps = true;
        parameter.fontParameters.minFilter = Texture.TextureFilter.Linear;
        parameter.fontParameters.magFilter = Texture.TextureFilter.Linear;
    }
    parameter.fontFileName = filePath;
    parameter.fontParameters.size = size;

    APP.assets.load(fileName, BitmapFont.class, parameter);
    APP.assets.finishLoading();

    font = APP.assets.get(fileName, BitmapFont.class);
}
项目:dynamicpool    文件:AssetGameScreen.java   
public void load(AssetManager assetManager) {
    background.load(assetManager);
    fish1.load(assetManager);
    fish2.load(assetManager);
    fish3.load(assetManager);
    fish4.load(assetManager);
    fish5.load(assetManager);
    fish6.load(assetManager);
    fish7.load(assetManager);
    fish8.load(assetManager);
    fish9.load(assetManager);
    fish10.load(assetManager);
    assetManager.load(AppConst.EXIT_BUTTON_TEXTURE, Texture.class);
    assetManager.load(AppConst.ADD_FISH_BUTTON_TEXTURE, Texture.class);
    assetManager.load(AppConst.SELECT_FISH_BUTTONS_TEXTURE, Texture.class);
    assetManager.load(AppConst.SELECT_TRAJECTORY_TEXTURE, Texture.class);
    FileHandleResolver resolver = new InternalFileHandleResolver();
    assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    assetManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));
    FreeTypeFontLoaderParameter size1Params = new FreeTypeFontLoaderParameter();
    size1Params.fontFileName = AppConst.DEFAUFT_FONT;
    size1Params.fontParameters.size =  AppConst.KEY_FONT_SIZE;
    assetManager.load(AppConst.KEY_FONT_NAME, BitmapFont.class, size1Params);
}
项目:SMC-Android    文件:SettingsDialog.java   
public void loadAssets()
  {
      screen.game.assets.manager.load("data/hud/hud.pack", TextureAtlas.class);

screen.game.assets.manager.load("data/hud/dialog_background.png", Texture.class, screen.game.assets.textureParameter);
      FreetypeFontLoader.FreeTypeFontLoaderParameter params = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
      params.fontFileName = "data/fonts/GROBOLD.ttf";//Constants.DEFAULT_FONT_FILE_NAME;
      params.fontParameters.magFilter = Texture.TextureFilter.Linear;
      params.fontParameters.minFilter = Texture.TextureFilter.Linear;
      params.fontParameters.size = (int) (cam.viewportHeight / 30);
      params.fontParameters.characters = "YesNoStingTxurQaly";
      params.fontParameters.borderWidth = 2f;
      screen.game.assets.manager.load("settings_dialog.ttf", BitmapFont.class, params);

      params = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
      params.fontFileName = "data/fonts/GROBOLD.ttf";//Constants.DEFAULT_FONT_FILE_NAME;
      params.fontParameters.magFilter = Texture.TextureFilter.Linear;
      params.fontParameters.minFilter = Texture.TextureFilter.Linear;
      params.fontParameters.characters = "LOWHIGMEDU";
      params.fontParameters.size = (int) (cam.viewportHeight / 40);
      params.fontParameters.borderWidth = 2f;
      screen.game.assets.manager.load("texture_quality.ttf", BitmapFont.class, params);
  }
项目:SMC-Android    文件:Assets.java   
public Assets()
{
    textureParameter = new TextureLoader.TextureParameter();
    //textureParameter.genMipMaps = true;
    textureParameter.magFilter = Texture.TextureFilter.Linear;
    textureParameter.minFilter = Texture.TextureFilter.Linear;

    resolver = new MaryoFileHandleResolver();
    manager = new AssetManager(resolver);

    particleEffectParameter = new ParticleEffectLoader.ParticleEffectParameter();
    particleEffectParameter.imagesDir = resolver.resolve("data/animation/particles");

    // set the loaders for the generator and the fonts themselves
    manager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    manager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));
    manager.setLoader(ParticleEffect.class, ".p", new ParticleEffectLoader(resolver));
    manager.setLoader(Sound.class, ".mp3", new SoundLoader(new InternalFileHandleResolver()));
    manager.setLoader(Music.class, ".mp3", new MusicLoader(new InternalFileHandleResolver()));
}
项目:Fruit-Destroyer    文件:Font.java   
public Font(final Application APP, String fileName, String filePath, int size, Color color, boolean filter)
{
    // ASSIGN ATTRIBUTES
    this.size = size;
    this.color = color;

    FreetypeFontLoader.FreeTypeFontLoaderParameter parameter = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    FileHandleResolver resolver = new InternalFileHandleResolver();

    APP.assets.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    APP.assets.setLoader(BitmapFont.class, ".otf", new FreetypeFontLoader(resolver));

    // GENERATE FONT
    if (filter) // IF FILTER ENABLED
    {
        parameter.fontParameters.genMipMaps = true;
        parameter.fontParameters.minFilter = Texture.TextureFilter.Linear;
        parameter.fontParameters.magFilter = Texture.TextureFilter.Linear;
    }
    parameter.fontFileName = filePath;
    parameter.fontParameters.size = size;
    parameter.fontParameters.color = color;

    APP.assets.load(fileName, BitmapFont.class, parameter);
    APP.assets.finishLoading();

    font = APP.assets.get(fileName, BitmapFont.class);
}
项目:Fruit-Destroyer    文件:Font.java   
public Font(final Application APP, String fileName, String filePath, int size, Color color, Color borderColor, float borderWidth, boolean filter)
{
    // ASSIGN ATTRIBUTES
    this.size = size;
    this.color = color;

    FreetypeFontLoader.FreeTypeFontLoaderParameter parameter = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    FileHandleResolver resolver = new InternalFileHandleResolver();

    APP.assets.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    APP.assets.setLoader(BitmapFont.class, ".otf", new FreetypeFontLoader(resolver));

    // GENERATE FONT
    if (filter) // IF FILTER ENABLED
    {
        parameter.fontParameters.genMipMaps = true;
        parameter.fontParameters.minFilter = Texture.TextureFilter.Linear;
        parameter.fontParameters.magFilter = Texture.TextureFilter.Linear;
    }
    parameter.fontFileName = filePath;
    parameter.fontParameters.size = size;
    parameter.fontParameters.color = color;
    parameter.fontParameters.borderColor = borderColor;
    parameter.fontParameters.borderWidth = borderWidth;

    APP.assets.load(fileName, BitmapFont.class, parameter);
    APP.assets.finishLoading();

    font = APP.assets.get(fileName, BitmapFont.class);
}
项目:abattle    文件:AssetManagerImpl.java   
public AssetManagerImpl() {
  com.badlogic.gdx.assets.AssetManager _assetManager = new com.badlogic.gdx.assets.AssetManager();
  this.manager = _assetManager;
  final InternalFileHandleResolver resolver = new InternalFileHandleResolver();
  FreeTypeFontGeneratorLoader _freeTypeFontGeneratorLoader = new FreeTypeFontGeneratorLoader(resolver);
  this.manager.<FreeTypeFontGenerator, FreeTypeFontGeneratorLoader.FreeTypeFontGeneratorParameters>setLoader(FreeTypeFontGenerator.class, _freeTypeFontGeneratorLoader);
  FreetypeFontLoader _freetypeFontLoader = new FreetypeFontLoader(resolver);
  this.manager.<BitmapFont, FreetypeFontLoader.FreeTypeFontLoaderParameter>setLoader(BitmapFont.class, ".ttf", _freetypeFontLoader);
  this.fixAssetResolutions();
}
项目:abattle    文件:AssetManagerImpl.java   
private void loadFont(final String filename, final String fontname, final int size) {
  FreetypeFontLoader.FreeTypeFontLoaderParameter sizeParams = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
  sizeParams.fontFileName = filename;
  sizeParams.fontParameters.size = size;
  sizeParams.fontParameters.characters = ClientConstants.ALL_CHARACTERS;
  sizeParams.fontParameters.genMipMaps = true;
  this.manager.<BitmapFont>load(fontname, BitmapFont.class, sizeParams);
}
项目:libgdxcn    文件:FreeTypeFontLoaderTest.java   
@Override
public void create () {
    manager = new AssetManager();

    // set the loaders for the generator and the fonts themselves
    FileHandleResolver resolver = new InternalFileHandleResolver();
    manager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    manager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));

    // load to fonts via the generator (implicitely done by the FreetypeFontLoader).
    // Note: you MUST specify a FreetypeFontGenerator defining the ttf font file name and the size
    // of the font to be generated. The names of the fonts are arbitrary and are not pointing
    // to a file on disk!
    FreeTypeFontLoaderParameter size1Params = new FreeTypeFontLoaderParameter();
    size1Params.fontFileName = "data/arial.ttf";
    size1Params.fontParameters.size = 10;
    manager.load("size10.ttf", BitmapFont.class, size1Params);

    FreeTypeFontLoaderParameter size2Params = new FreeTypeFontLoaderParameter();
    size2Params.fontFileName = "data/arial.ttf";
    size2Params.fontParameters.size = 20;
    manager.load("size20.ttf", BitmapFont.class, size2Params);

    // we also load a "normal" font generated via Hiero
    manager.load("data/default.fnt", BitmapFont.class);

    batch = new SpriteBatch();
}
项目:bladecoder-adventure-engine    文件:EngineAssetManager.java   
protected EngineAssetManager(FileHandleResolver resolver) {
    super(resolver);

    resResolver = new EngineResolutionFileResolver(resolver);
    setLoader(Texture.class, new TextureLoader(resResolver));
    setLoader(TextureAtlas.class, new TextureAtlasLoader(resResolver));
    setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));

    Texture.setAssetManager(this);
}
项目:dynamicpool    文件:AssetLoadingScreen.java   
public void load(AssetManager assetManager) {
    FileHandleResolver resolver = new InternalFileHandleResolver();
    assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    assetManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));
    FreeTypeFontLoaderParameter size1Params = new FreeTypeFontLoaderParameter();
    size1Params.fontFileName = AppConst.DEFAUFT_FONT;
    size1Params.fontParameters.size =  AppConst.LOADING_FONT_SIZE;
    assetManager.load(AppConst.LOADING_FONT_NAME, BitmapFont.class, size1Params);
}
项目:SMC-Android    文件:HUD.java   
public void loadAssets()
{
    world.screen.game.assets.manager.load("data/sounds/item/live_up_2.mp3", Sound.class);

    world.screen.game.assets.manager.load("data/hud/controls.pack", TextureAtlas.class);
    world.screen.game.assets.manager.load("data/hud/SMCLook512.pack", TextureAtlas.class);
    world.screen.game.assets.manager.load("data/hud/hud.pack", TextureAtlas.class);
    world.screen.game.assets.manager.load("data/game/itembox.png", Texture.class, world.screen.game.assets.textureParameter);
       world.screen.game.assets.manager.load("data/game/maryo_l.png", Texture.class, world.screen.game.assets.textureParameter);
       world.screen.game.assets.manager.load("data/game/gold_m.png", Texture.class, world.screen.game.assets.textureParameter);
    world.screen.game.assets.manager.load("data/game/game_over.png", Texture.class, world.screen.game.assets.textureParameter);

    FreetypeFontLoader.FreeTypeFontLoaderParameter ttsTextParams = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
       ttsTextParams.fontFileName = Constants.DEFAULT_FONT_FILE_NAME;
       ttsTextParams.fontParameters.size = (int) C_H / 15;
       ttsTextParams.fontParameters.characters = "TOUCHANYWERS";
    ttsTextParams.fontParameters.borderWidth = 2f;
    world.screen.game.assets.manager.load("touch_to_start.ttf", BitmapFont.class, ttsTextParams);

    FreetypeFontLoader.FreeTypeFontLoaderParameter boxPD = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    boxPD.fontFileName = "data/fonts/MyriadPro-Regular.otf";
    boxPD.fontParameters.size = (int) HUD.C_H / 30;
    boxPD.fontParameters.borderWidth = 2f;
    world.screen.game.assets.manager.load("btf.ttf", BitmapFont.class, boxPD);

    FreetypeFontLoader.FreeTypeFontLoaderParameter pauseParams = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    pauseParams.fontFileName = Constants.DEFAULT_FONT_FILE_NAME;
    pauseParams.fontParameters.size = (int) C_H / 4;
    pauseParams.fontParameters.characters = "PAUSE";
    pauseParams.fontParameters.borderWidth = 2f;
    world.screen.game.assets.manager.load("pause.ttf", BitmapFont.class, pauseParams);
}
项目:SMC-Android    文件:ConfirmDialog.java   
public void loadAssets()
  {
      screen.game.assets.manager.load("data/hud/hud.pack", TextureAtlas.class);

screen.game.assets.manager.load("data/hud/dialog_background.png", Texture.class, screen.game.assets.textureParameter);
      FreetypeFontLoader.FreeTypeFontLoaderParameter params = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
      params.fontFileName = "data/fonts/GROBOLD.ttf";//Constants.DEFAULT_FONT_FILE_NAME;
      params.fontParameters.magFilter = Texture.TextureFilter.Linear;
      params.fontParameters.minFilter = Texture.TextureFilter.Linear;
      params.fontParameters.size = (int) (cam.viewportHeight / 23);
      params.fontParameters.characters = "YesNoOESAryuwantqi?lvdpgb.DQ";
      params.fontParameters.borderWidth = 2f;
      screen.game.assets.manager.load("confirm_dialog.ttf", BitmapFont.class, params);
  }
项目:ProjektGG    文件:ProjektGG.java   
@Override
public final void create() {
    if (debug)
        Gdx.app.setLogLevel(Gdx.app.LOG_DEBUG);
    else
        Gdx.app.setLogLevel(Gdx.app.LOG_INFO);

    // Initialize sprite batch
    this.batch = new SpriteBatch();

    // Initialize asset manager
    FileHandleResolver resolver = new InternalFileHandleResolver();
    this.assetManager.setLoader(FreeTypeFontGenerator.class,
            new FreeTypeFontGeneratorLoader(resolver));
    this.assetManager.setLoader(BitmapFont.class, ".ttf",
            new FreetypeFontLoader(resolver));

    this.viewportWidth = Gdx.graphics.getWidth();
    this.viewportHeight = Gdx.graphics.getHeight();

    // Initialize cameras
    this.uiCamera = new OrthographicCamera(viewportWidth, viewportHeight);
    this.uiCamera.translate(viewportWidth / 2, viewportHeight / 2, 0);
    this.uiCamera.update();

    this.gameCamera = new PerspectiveCamera(0, viewportWidth,
            viewportHeight);
    this.gameCamera.translate(viewportWidth / 2, viewportHeight / 2, 0);
    // this.camera.update();
    this.batch.setProjectionMatrix(this.gameCamera.combined);

    // Create new cursor manager
    this.cursorManager = new CursorManager();

    // Load game settings
    this.settings = new Settings("projekt-gg");

    // Set input processor
    Gdx.input.setInputProcessor(inputProcessor);

    // Add screens
    addScreen("splash", new SplashScreen());
    addScreen("mainMenu", new MainMenuScreen());
    addScreen("loading", new LoadingScreen());
    addScreen("serverBrowser", new ServerBrowserScreen());
    addScreen("lobby", new LobbyScreen());
    addScreen("lobbyCreation", new LobbyCreationScreen());
    addScreen("map", new GameMapScreen());
    addScreen("house", new GameHouseScreen());
    addScreen("roundEnd", new GameRoundendScreen());

    // Push screen
    if (showSplashscreen)
        pushScreen("splash");
    else
        pushScreen("loading");
}
项目:CatchDROP    文件:CDGame.java   
public void create() {
    assManager = new AssetManager(); // I manage dat ass...

    FileHandleResolver resolver = new InternalFileHandleResolver();
    assManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver));
    assManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver));

    FreeTypeFontLoaderParameter titleParams = new FreeTypeFontLoaderParameter();
    titleParams.fontFileName = "font/atari.ttf";
    titleParams.fontParameters.size = 75;
    assManager.load("title.ttf", BitmapFont.class, titleParams);

    FreeTypeFontLoaderParameter promptParams = new FreeTypeFontLoaderParameter();
    promptParams.fontFileName = "font/MyriadPro-Regular.otf";
    promptParams.fontParameters.size = 35;
    assManager.load("prompt.ttf", BitmapFont.class, promptParams);

    FreeTypeFontLoaderParameter promptBoldParams = new FreeTypeFontLoaderParameter();
    promptBoldParams.fontFileName = "font/MyriadPro-Bold.otf";
    promptBoldParams.fontParameters.size = 35;
    assManager.load("prompt_bold.ttf", BitmapFont.class, promptBoldParams);

    FreeTypeFontLoaderParameter scoreParams1 = new FreeTypeFontLoaderParameter();
    scoreParams1.fontFileName = "font/atari.ttf";
    scoreParams1.fontParameters.size = 20;
    assManager.load("score.ttf", BitmapFont.class, scoreParams1);

    FreeTypeFontLoaderParameter timerParams = new FreeTypeFontLoaderParameter();
    timerParams.fontFileName = "font/atari.ttf";
    timerParams.fontParameters.size = 25;
    assManager.load("timer.ttf", BitmapFont.class, timerParams);

    FreeTypeFontLoaderParameter goverParams = new FreeTypeFontLoaderParameter();
    goverParams.fontFileName = "font/MyriadPro-Bold.otf";
    goverParams.fontParameters.size = 95;
    assManager.load("gover.ttf", BitmapFont.class, goverParams);

    FreeTypeFontLoaderParameter versionParams = new FreeTypeFontLoaderParameter();
    versionParams.fontFileName = "font/prstartk.ttf";
    versionParams.fontParameters.size = 15;
    assManager.load("corner.ttf", BitmapFont.class, versionParams);

    FreeTypeFontLoaderParameter menuFontParams = new FreeTypeFontLoaderParameter();
    menuFontParams.fontFileName = "font/MyriadPro-Bold.otf";
    menuFontParams.fontParameters.size = 25;
    assManager.load("size20.ttf", BitmapFont.class, menuFontParams);

    FreeTypeFontLoaderParameter headerParams = new FreeTypeFontLoaderParameter();
    headerParams.fontFileName = "font/arial.ttf";
    headerParams.fontParameters.size = 50;
    assManager.load("heading.ttf", BitmapFont.class, headerParams); 

    if(usingDesktop) autoPause = false;

    gamePrefs = Gdx.app.getPreferences("Game");
    //gamePrefs.getLong("highscore", 0);

    batch = new SpriteBatch();
    shapeRender = new ShapeRenderer();

    camera = new OrthographicCamera();
    camera.setToOrtho(false, GAME_WIDTH, GAME_HEIGHT);
    camera.viewportWidth = GAME_WIDTH;
    camera.viewportHeight = GAME_HEIGHT;

    mMScr = new MainMenuScreen(this);
    //gScr = new GameScreen(this);
    //gScr = new ZenGame(this);
    //gSettings = new SettingsScreen(this);

    this.setScreen(mMScr);
}
项目:SMC-Android    文件:GameScreen.java   
@Override
public void loadAssets()
{
    loader.parseLevel(world);
    for (Maryo.MaryoState ms : Maryo.MaryoState.values())
    {
        game.assets.manager.load("data/maryo/" + ms.toString() + ".pack", TextureAtlas.class);
    }
    game.assets.manager.load("data/animation/fireball.pack", TextureAtlas.class);
    game.assets.manager.load("data/animation/particles/fireball_emitter_2.p", ParticleEffect.class, game.assets.particleEffectParameter);
    game.assets.manager.load("data/animation/particles/fireball_explosion_emitter.p", ParticleEffect.class, game.assets.particleEffectParameter);
    game.assets.manager.load("data/animation/particles/iceball_emitter.p", ParticleEffect.class, game.assets.particleEffectParameter);
    game.assets.manager.load("data/animation/particles/iceball_explosion_emitter.p", ParticleEffect.class, game.assets.particleEffectParameter);
    game.assets.manager.load("data/animation/particles/star_trail.p", ParticleEffect.class, game.assets.particleEffectParameter);
    game.assets.manager.load("data/animation/particles/maryo_star.p", ParticleEffect.class, game.assets.particleEffectParameter);
    game.assets.manager.load("data/animation/iceball.png", Texture.class, game.assets.textureParameter);
    game.assets.manager.load("data/game/game_over.png", Texture.class);
    hud.loadAssets();

    //audio
    game.assets.manager.load("data/sounds/audio_on.mp3", Sound.class);
    game.assets.manager.load("data/sounds/item/goldpiece_1.mp3", Sound.class);
    game.assets.manager.load("data/sounds/item/goldpiece_red.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/dead.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/jump_big.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/jump_big_power.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/jump_small.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/jump_small_power.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/pickup_item.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/powerdown.mp3", Sound.class);
    game.assets.manager.load("data/sounds/player/run_stop.mp3", Sound.class);
    game.assets.manager.load("data/sounds/wall_hit.mp3", Sound.class);
    game.assets.manager.load("data/sounds/item/fireball.mp3", Sound.class);
    game.assets.manager.load("data/sounds/item/iceball.mp3", Sound.class);

    game.assets.manager.load("data/sounds/sprout_1.mp3", Sound.class);
    game.assets.manager.load("data/sounds/item/star_kill.mp3", Sound.class);
    game.assets.manager.load("data/sounds/itembox_set.mp3", Sound.class);
    game.assets.manager.load("data/sounds/leave_pipe.mp3", Sound.class);
    game.assets.manager.load("data/sounds/enter_pipe.mp3", Sound.class);

    game.assets.manager.load("data/sounds/enemy/furball/die.mp3", Sound.class);
    game.assets.manager.load("data/sounds/item/fireball_repelled.mp3", Sound.class);

    game.assets.manager.load("data/sounds/item/iceball_explosion.mp3", Sound.class);
    game.assets.manager.load("data/sounds/item/fireball_explosion.mp3", Sound.class);

    game.assets.manager.load("data/music/game/lost_1.mp3", Music.class);
    game.assets.manager.load("data/music/game/courseclear.mp3", Music.class);

    FreetypeFontLoader.FreeTypeFontLoaderParameter debugFontParams = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    debugFontParams.fontFileName = "data/fonts/MyriadPro-Regular.otf";
    debugFontParams.fontParameters.size = (int) (height / 25f);
    debugFontParams.fontParameters.characters = FreeTypeFontGenerator.DEFAULT_CHARS;
    game.assets.manager.load("debug.ttf", BitmapFont.class, debugFontParams);

    debugFontParams = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    debugFontParams.fontFileName = Constants.DEFAULT_FONT_FILE_NAME;
    debugFontParams.fontParameters.size = (int) (height / 40f);
    debugFontParams.fontParameters.characters = FreeTypeFontGenerator.DEFAULT_CHARS;
    game.assets.manager.load("debug_object.ttf", BitmapFont.class, debugFontParams);

    exitDialog.loadAssets();

    FreetypeFontLoader.FreeTypeFontLoaderParameter pointsParams = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
    pointsParams.fontFileName = Constants.DEFAULT_FONT_FILE_NAME;
    pointsParams.fontParameters.size = 19;
    pointsParams.fontParameters.magFilter = Texture.TextureFilter.Linear;
    pointsParams.fontParameters.minFilter = Texture.TextureFilter.Linear;
    pointsParams.fontParameters.characters = "0123456789";
    game.assets.manager.load("kill-points.ttf", BitmapFont.class, pointsParams);

}
项目:vis-editor    文件:FreeTypeFontProvider.java   
@Override
public void setLoaders (AssetManager assetManager) {
    assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(assetManager.getFileHandleResolver()));
    assetManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(assetManager.getFileHandleResolver()));
}