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


Java FontFactory类代码示例

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


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

示例1: ImageMatchGameHUD

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
public ImageMatchGameHUD(final PhoeniciaGame phoeniciaGame, final Level level, final GameTile tile) {
    super(phoeniciaGame, level, tile);
    this.setBackgroundEnabled(false);
    this.level = level;
    this.tile = tile;
    this.current_round = 0;
    this.random_word_list = new ArrayList<Word>(level.words);
    Collections.shuffle(this.random_word_list);

    Debug.d("ImageMatchGame level: " + level.name);
    Debug.d("ImageMatchGame words: " + level.words.size());

    if (this.random_word_list.size() < this.max_rounds) {
        this.max_rounds = this.random_word_list.size();
    }
    Debug.d("ImageMatchGame  rounds: "+this.max_rounds);

    if (this.random_word_list.size() < this.max_choices) {
        this.max_choices = this.random_word_list.size();
    }

    this.touchAreas = new ArrayList<Entity>();
    choiceWordFont = FontFactory.create(PhoeniciaContext.fontManager, PhoeniciaContext.textureManager, 256, 256, TextureOptions.BILINEAR, Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 36, Color.BLUE_ARGB_PACKED_INT);
    choiceWordFont.load();

    this.cardPane = new Entity(WINDOW_WIDTH/2, 400, WINDOW_WIDTH, 400);
    this.content.attachChild(cardPane);

    this.resultsPane = new Entity(WINDOW_WIDTH/2, 100, WINDOW_WIDTH, 200);
    this.content.attachChild(this.resultsPane);
    this.winnings = new ArrayList<Word>();
    this.result_number = 0;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:34,代码来源:ImageMatchGameHUD.java

示例2: WordMatchGameHUD

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
public WordMatchGameHUD(final PhoeniciaGame phoeniciaGame, final Level level, final GameTile tile) {
        super(phoeniciaGame, level, tile);

        this.level = level;
        this.tile = tile;
        this.current_round = 0;
        this.random_word_list = new ArrayList<Word>(level.words);
        Collections.shuffle(this.random_word_list);

        if (this.random_word_list.size() < this.max_rounds) {
            this.max_rounds = this.random_word_list.size();
        }
        Debug.d("WordMatchGame rounds: "+this.max_rounds);

        if (this.random_word_list.size() < this.max_choices) {
            this.max_choices = this.random_word_list.size();
        }

        this.touchAreas = new ArrayList<Entity>();
        choiceWordFont = FontFactory.create(PhoeniciaContext.fontManager, PhoeniciaContext.textureManager, 256, 256, TextureOptions.BILINEAR, Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 36, Color.BLUE_ARGB_PACKED_INT);
        choiceWordFont.load();

//        final float dialogWidth = 800;
//        final float dialogHeight = 600;
//        Rectangle whiteRect = new BorderRectangle(GameActivity.CAMERA_WIDTH / 2, GameActivity.CAMERA_HEIGHT / 2, dialogWidth, dialogHeight, PhoeniciaContext.vboManager);
//        whiteRect.setColor(Color.WHITE);
//        this.attachChild(whiteRect);

        this.cardPane = new Entity(WINDOW_WIDTH/2, 400, WINDOW_WIDTH, 400);
        this.content.attachChild(cardPane);

        this.resultsPane = new Entity(WINDOW_WIDTH/2, 100, WINDOW_WIDTH, 200);
        this.content.attachChild(this.resultsPane);
        this.winnings = new ArrayList<Word>();
        this.result_number = 0;
    }
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:37,代码来源:WordMatchGameHUD.java

示例3: dialogText

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
/**
 * Font used for displaying text in a Button
 * @return
 */
public static Font dialogText() {
    if (dialogFont == null) {
        BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
        dialogFont = FontFactory.create(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 32, true, new Color(0.5f, 0.5f, 0.5f).getABGRPackedInt());
        dialogFont.load();
    }
    return dialogFont;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:13,代码来源:GameFonts.java

示例4: itemCost

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
/**
 * Font used for displaying the cost of an InventoryItem.
 * @return
 */
public static Font itemCost() {
    if (itemCostFont == null) {
        BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
        itemCostFont = FontFactory.createStroke(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 24, true, new Color(0.96f, 0.70f, 0f).getARGBPackedInt(), 0.5f, new Color(0.95f, 0.61f, 0f).getARGBPackedInt());
        itemCostFont.load();
    }
    return itemCostFont;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:13,代码来源:GameFonts.java

示例5: inventoryCount

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
/**
 * Font used for displaying the quantity of an InventoryItem.
 * @return
 */
public static Font inventoryCount() {
    if (inventoryCountFont == null) {
        BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
        inventoryCountFont = FontFactory.create(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 24, true, new Color(0.5f, 0.5f, 0.5f).getABGRPackedInt());
        inventoryCountFont.load();
    }
    return inventoryCountFont;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:13,代码来源:GameFonts.java

示例6: defaultHUDDisplay

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
/**
 * Font used for displaying the level and account balance in the DefaultHUD.
 * @return
 */
public static Font defaultHUDDisplay() {
    if (defaultHUDDisplayFont == null) {
        BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
        defaultHUDDisplayFont = FontFactory.create(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 30, true, Color.WHITE_ARGB_PACKED_INT);
        defaultHUDDisplayFont.load();
    }
    return defaultHUDDisplayFont;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:13,代码来源:GameFonts.java

示例7: introText

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
public static Font introText() {
    if (introTextFont == null) {
        BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
        introTextFont = FontFactory.create(PhoeniciaContext.fontManager, PhoeniciaContext.textureManager, 256, 256, TextureOptions.BILINEAR, Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 36, Color.BLUE_ARGB_PACKED_INT);
        introTextFont.load();
    }
    return introTextFont;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:9,代码来源:GameFonts.java

示例8: buttonText

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
/**
 * Font used for displaying text in a Button
 * @return
 */
public static Font buttonText() {
    if (buttonFont == null) {
        Color borderColor = new Color(20/255f, 91/255f, 164/255f);
        BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
        buttonFont = FontFactory.createStroke(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 32, true, Color.WHITE_ARGB_PACKED_INT, 0.75f, borderColor.getARGBPackedInt());
        buttonFont.load();
    }
    return buttonFont;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:14,代码来源:GameFonts.java

示例9: progressText

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
public static Font progressText() {
    if (progressFont == null) {
        BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
        progressFont = FontFactory.createStroke(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 24, true, Color.WHITE_ARGB_PACKED_INT, 0.5f, Color.BLUE_ARGB_PACKED_INT);
        progressFont.load();
    }
    return progressFont;
}
 
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:9,代码来源:GameFonts.java

示例10: loadFont

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
private Font loadFont(String fontName, int fontSize) {
    FontFactory.setAssetBasePath("font/");
    Font fontRes;
    fontRes = FontFactory.createFromAsset(engine.getFontManager(), engine.getTextureManager(), 512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA, context.getAssets(), fontName
            , fontSize, true, Color.WHITE);
    fontRes.load();
    return fontRes;
}
 
开发者ID:viniciusDSL,项目名称:One-Cachito,代码行数:9,代码来源:ResourceManager.java

示例11: loadMenuFonts

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
public void loadMenuFonts() {

        FontFactory.setAssetBasePath("font/");
        final ITexture menuTexture = new BitmapTextureAtlas(mContext.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
        mMenuFont = FontFactory.createFromAsset(mContext.getFontManager(), menuTexture, mContext.getAssets(), "LCD.ttf", 18f, false, android.graphics.Color.BLACK);
        menuTexture.load();
        mMenuFont.load();

    }
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:10,代码来源:ResourceManager.java

示例12: init

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
@Override
public void init(GameLevel gameLevel, PhysicsWorld physicsWorld, Engine engine) {
    super.init(gameLevel, physicsWorld, engine);

    float camHeight = engine.getCamera().getHeight();
    float originalHeight = 1920;
    float heightScale = camHeight / originalHeight;

    Typeface typeFace = Typeface.createFromAsset(GoogleFlipGameApplication.sContext.getAssets(), FontFaceType.FUTURA_BOOK.getAssetName());

    Font explanationFont = FontFactory.create(_engine.getFontManager(), _engine.getTextureManager(), 512, 768, TextureOptions.BILINEAR, typeFace, (int) 20 * GoogleFlipGameApplication.sContext.getResources().getDisplayMetrics().density, Color.WHITE_ABGR_PACKED_INT);
    explanationFont.load();

    _engine.getFontManager().loadFont(explanationFont);

    Vector2 textPoint = Vector2Pool.obtain(_engine.getCamera().getWidth() / 2, _engine.getCamera().getHeight() * .70f);
    String explanation1, explanation2;

    switch (GoogleFlipGameApplication.getUserModel().getTutorialLevel()) {
        case 1:
            explanation1 = GoogleFlipGameApplication.sContext.getResources().getString(R.string.tutorial_2a);
            explanation2 = GoogleFlipGameApplication.sContext.getResources().getString(R.string.tutorial_2b);
            break;
        case 2:
            explanation1 = GoogleFlipGameApplication.sContext.getResources().getString(R.string.tutorial_3);
            explanation2 = "";
            break;
        default:
            explanation1 = GoogleFlipGameApplication.sContext.getResources().getString(R.string.tutorial_1a);
            explanation2 = GoogleFlipGameApplication.sContext.getResources().getString(R.string.tutorial_1b);
break;
    }

    _explanationText1 = new Text(textPoint.x, textPoint.y, explanationFont, explanation1, new TextOptions(HorizontalAlign.CENTER), _engine.getVertexBufferObjectManager());
    _explanationText2 = new Text(textPoint.x, textPoint.y - (_explanationText1.getHeight()), explanationFont, explanation2, new TextOptions(HorizontalAlign.CENTER), _engine.getVertexBufferObjectManager());

    _engine.getScene().attachChild(_explanationText1);
    _engine.getScene().attachChild(_explanationText2);
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:40,代码来源:TutorialLevelController.java

示例13: getFont

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
IFont getFont(final String name, float size, int color, float strokeWidth, int strokeColor) {

        FontFactory.setAssetBasePath("fonts/");

        final ITexture mainFontTexture = new BitmapTextureAtlas(textureManager, 1024, 1024, TextureOptions.BILINEAR);
        IFont font = FontFactory.createStrokeFromAsset(fontManager, mainFontTexture, assetManager, name, size, true,
                color, strokeWidth, strokeColor);
        font.load();

        return font;
    }
 
开发者ID:djschilling,项目名称:sopa,代码行数:12,代码来源:ResourceLoader.java

示例14: loadFonts

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
private void loadFonts() {
	FontFactory.setAssetBasePath(FONT_DIR);
	mFontSmallTexture = new BitmapTextureAtlas(mActivity.getTextureManager(), 512, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
	mFontSmall = FontFactory.createStrokeFromAsset(mActivity.getFontManager(), mFontSmallTexture, mActivity.getAssets(), FONT_1, FONT_SIZE_SMALL, true, Color.WHITE, 2, Color.BLACK);
	mFontSmall.load();
	mFontBigTexture = new BitmapTextureAtlas(mActivity.getTextureManager(), 512, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
	mFontBig = FontFactory.createStrokeFromAsset(mActivity.getFontManager(), mFontBigTexture, mActivity.getAssets(), FONT_1, FONT_SIZE_BIG, true, Color.WHITE, 3, Color.BLACK);
	mFontBig.load();
}
 
开发者ID:delight-im,项目名称:NationSoccer,代码行数:10,代码来源:ResourcesManager.java

示例15: loadMenuFonts

import org.andengine.opengl.font.FontFactory; //导入依赖的package包/类
private void loadMenuFonts()
{
	FontFactory.setAssetBasePath("font/");
	final ITexture mainFontTexture = new BitmapTextureAtlas(activity.getTextureManager(),256,256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
	font = FontFactory.createStrokeFromAsset(activity.getFontManager(), mainFontTexture, activity.getAssets(), "font.ttf", 50, true, Color.WHITE, 2, Color.BLACK);
	font.load();
}
 
开发者ID:LHBDev,项目名称:MoonMiner,代码行数:8,代码来源:ResourcesManager.java


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