Example usage for com.badlogic.gdx.graphics.g2d BitmapFont setUseIntegerPositions

List of usage examples for com.badlogic.gdx.graphics.g2d BitmapFont setUseIntegerPositions

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d BitmapFont setUseIntegerPositions.

Prototype

public void setUseIntegerPositions(boolean integer) 

Source Link

Document

Specifies whether to use integer positions or not.

Usage

From source file:com.kotcrab.vis.editor.module.project.TtfEditorFont.java

License:Apache License

public BitmapFont get(int size) {
    BitmapFont font = bitmapFonts.get(size);

    if (font == null) {
        font = generator.generateFont(getParameterForSize(size));
        font.setUseIntegerPositions(false);
        font.getData().setScale(1f / pixelsPerUnit);
        bitmapFonts.put(size, font);/*  w w  w  .j  av a2  s  .  c o m*/
    }

    return font;
}

From source file:com.kotcrab.vis.runtime.system.inflater.TextInflater.java

License:Apache License

@Override
public void inserted(int entityId) {
    VisAssetDescriptor asset = assetCm.get(entityId).asset;
    ProtoVisText protoComponent = protoCm.get(entityId);

    BitmapFont font;

    if (asset instanceof BmpFontAsset) {
        BmpFontAsset fontAsset = (BmpFontAsset) asset;
        font = manager.get(fontAsset.getPath(), BitmapFont.class);
    } else if (asset instanceof TtfFontAsset) {
        TtfFontAsset fontAsset = (TtfFontAsset) asset;
        font = manager.get(fontAsset.getArbitraryFontName(), BitmapFont.class);
    } else/*from w  w w .j  av a2  s .c om*/
        throw new UnsupportedAssetDescriptorException(asset);

    if (font == null)
        throw new IllegalStateException("Can't load scene, font is missing: " + ((PathAsset) asset).getPath());

    font.setUseIntegerPositions(false);
    font.getData().setScale(1f / pixelsPerUnit);

    VisText text = textCm.create(entityId);

    text.init(font, protoComponent.text);
    protoComponent.fill(text);
    //text.setFontSize(fontSize); //font size must be handled manually from SceneLoader because it is not a public property for TextEntity

    protoCm.remove(entityId);
}

From source file:com.tnf.ptm.assets.fonts.FontFileFormat.java

License:Apache License

@Override
public FontData load(ResourceUrn urn, List<AssetDataFile> inputs) throws IOException {
    String path = AssetHelper.resolveToPath(inputs.get(0));

    FileHandle handle = new FileHandle(Paths.get(path).toFile());
    BitmapFont bitmapFont = new BitmapFont(handle, true);
    bitmapFont.setUseIntegerPositions(false);
    return new FontData(bitmapFont);
}

From source file:name.herve.bastod.guifwk.GUIResources.java

License:Open Source License

public static BitmapFont createFont(String file, int size, Color color) {
    BitmapFont font = TrueTypeFontFactory.createBitmapFont(Gdx.files.internal(file), FONT_CHARACTERS,
            Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), size, Gdx.graphics.getWidth(),
            Gdx.graphics.getHeight());/*ww w  . j  a v a2  s .  com*/
    font.setColor(color);
    font.setUseIntegerPositions(true);
    font.setFixedWidthGlyphs(SCORE_CHARACTERS);
    return font;
}