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

项目:bladecoder-adventure-engine    文件:TextRenderer.java   
@Override
public void loadAssets() {
    FreeTypeFontLoaderParameter params = new FreeTypeFontLoaderParameter();

    float scale = EngineAssetManager.getInstance().getScale();

    params.fontFileName = EngineAssetManager.FONT_DIR + fontName + EngineAssetManager.FONT_EXT;
    params.fontParameters.size = (int)(fontSize * scale);
    params.fontParameters.borderWidth = (int)(borderWidth * scale);
    params.fontParameters.borderColor = borderColor;
    params.fontParameters.borderStraight = borderStraight;
    params.fontParameters.shadowOffsetX = (int)(shadowOffsetX * scale);
    params.fontParameters.shadowOffsetY = (int)(shadowOffsetY * scale);
    params.fontParameters.shadowColor = shadowColor;
    params.fontParameters.characters = "";
    params.fontParameters.incremental = true;
    params.fontParameters.magFilter = TextureFilter.Linear;
    params.fontParameters.minFilter = TextureFilter.Linear;

    EngineAssetManager.getInstance().load(fontName + getFontSize() + ".ttf", BitmapFont.class, params);
}
项目: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);
}
项目:ProjektGG    文件:LoadingScreen.java   
public final AssetDescriptor<BitmapFont> MAIN_FONT_19_PATH() {
    FreeTypeFontLoaderParameter font = new FreeTypeFontLoaderParameter();
    font.fontFileName = "fonts/AlemdraSC/AlmendraSC-Regular.ttf";
    font.fontParameters.size = 19;
    return new AssetDescriptor<BitmapFont>("mainFont19.ttf",
            BitmapFont.class, font);
}
项目:ProjektGG    文件:LoadingScreen.java   
public final AssetDescriptor<BitmapFont> MAIN_FONT_22_PATH() {
    FreeTypeFontLoaderParameter font = new FreeTypeFontLoaderParameter();
    font.fontFileName = "fonts/AlemdraSC/AlmendraSC-Regular.ttf";
    font.fontParameters.size = 22;
    return new AssetDescriptor<BitmapFont>("mainFont22.ttf",
            BitmapFont.class, font);
}
项目:ProjektGG    文件:LoadingScreen.java   
public final AssetDescriptor<BitmapFont> LETTER_FONT_20_PATH() {
    FreeTypeFontLoaderParameter font = new FreeTypeFontLoaderParameter();
    font.fontFileName = "fonts/Fredericka_the_Great/FrederickatheGreat-Regular.ttf";
    font.fontParameters.size = 20;
    return new AssetDescriptor<BitmapFont>("letterFont20.ttf",
            BitmapFont.class, font);
}
项目:ProjektGG    文件:LoadingScreen.java   
public final AssetDescriptor<BitmapFont> HANDWRITTEN_FONT_20_PATH() {
    FreeTypeFontLoaderParameter font = new FreeTypeFontLoaderParameter();
    font.fontFileName = "fonts/ReenieBeanie/ReenieBeanie.ttf";
    font.fontParameters.size = 20;
    return new AssetDescriptor<BitmapFont>("handwrittenFont20.ttf",
            BitmapFont.class, font);
}
项目: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();
}
项目: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);
}
项目:vis-editor    文件:FreeTypeFontProvider.java   
@Override
public void load (Array<AssetDescriptor> dependencies, VisAssetDescriptor asset) {
    TtfFontAsset ttfAsset = (TtfFontAsset) asset;

    FreeTypeFontLoaderParameter params = new FreeTypeFontLoaderParameter();
    params.fontFileName = ttfAsset.getPath();
    params.fontParameters.size = ttfAsset.getFontSize();

    dependencies.add(new AssetDescriptor<BitmapFont>(ttfAsset.getArbitraryFontName(), BitmapFont.class, params));
}
项目: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);
}