当前位置: 首页>>代码示例>>Java>>正文


Java FreeTypeFontGeneratorLoader类代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader的典型用法代码示例。如果您正苦于以下问题:Java FreeTypeFontGeneratorLoader类的具体用法?Java FreeTypeFontGeneratorLoader怎么用?Java FreeTypeFontGeneratorLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FreeTypeFontGeneratorLoader类属于com.badlogic.gdx.graphics.g2d.freetype包,在下文中一共展示了FreeTypeFontGeneratorLoader类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadAssets

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
private void loadAssets() {
    InternalFileHandleResolver fileHandler = new InternalFileHandleResolver();
    assetManager = new AssetManager(fileHandler);
    assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(fileHandler));

    assetManager.load(SKIN_PATH, Skin.class);
    assetManager.load(MASTER_PATH, TextureAtlas.class);
    assetManager.load(FONT_NORMAL_PATH, FreeTypeFontGenerator.class);
    assetManager.load(FONT_BOLD_PATH, FreeTypeFontGenerator.class);
    assetManager.load(MUSIC_PATH, Music.class);
    assetManager.load(MAIN_MENU_MUSIC_PATH, Music.class);
    assetManager.load(GOOD_PATH, Sound.class);
    assetManager.load(HALF_PATH, Sound.class);
    assetManager.load(BAD_PATH, Sound.class);
    assetManager.finishLoading();
}
 
开发者ID:DurianHLN,项目名称:Polymorph,代码行数:17,代码来源:Polymorph.java

示例2: Font

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
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);
}
 
开发者ID:NahroTo,项目名称:Fruit-Destroyer,代码行数:27,代码来源:Font.java

示例3: load

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
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);
}
 
开发者ID:phat-trien-phan-mem-phan-tan,项目名称:dynamicpool,代码行数:25,代码来源:AssetGameScreen.java

示例4: Assets

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
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()));
}
 
开发者ID:pedja1,项目名称:SMC-Android,代码行数:21,代码来源:Assets.java

示例5: loadInternal

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
private static void loadInternal() {
   if (Gdx.files == null)
      throw new RuntimeException("LibGDX is not initialized yet!");

   instance = new AssetManager();
   // TODO make FileHandleResolver injectible
   instance.setLoader(TiledMap.class, new TmxMapLoader());
   instance.setLoader(FreeTypeFontGenerator.class, 
 		   new FreeTypeFontGeneratorLoader(new InternalFileHandleResolver()));
}
 
开发者ID:bitbrain,项目名称:braingdx,代码行数:11,代码来源:SharedAssetManager.java

示例6: AssetManagerImpl

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
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();
}
 
开发者ID:CymricNPG,项目名称:abattle,代码行数:11,代码来源:AssetManagerImpl.java

示例7: create

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
@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();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:29,代码来源:FreeTypeFontLoaderTest.java

示例8: EngineAssetManager

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
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);
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:12,代码来源:EngineAssetManager.java

示例9: load

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
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);
}
 
开发者ID:phat-trien-phan-mem-phan-tan,项目名称:dynamicpool,代码行数:10,代码来源:AssetLoadingScreen.java

示例10: create

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
@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");
}
 
开发者ID:eskalon,项目名称:ProjektGG,代码行数:58,代码来源:ProjektGG.java

示例11: create

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
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);
}
 
开发者ID:buzzbyte,项目名称:CatchDROP,代码行数:73,代码来源:CDGame.java

示例12: setLoaders

import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader; //导入依赖的package包/类
@Override
public void setLoaders (AssetManager assetManager) {
	assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(assetManager.getFileHandleResolver()));
	assetManager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(assetManager.getFileHandleResolver()));
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:6,代码来源:FreeTypeFontProvider.java


注:本文中的com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。