Array<TextureRegion> regions = skin.getRegions(regionName); if (regions != null) font = new BitmapFont(new BitmapFontData(fontFile, flip), regions, true); else { TextureRegion region = skin.optional(regionName, TextureRegion.class);
@Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, BitmapFontParameter parameter) { Array<AssetDescriptor> deps = new Array(); if (parameter != null && parameter.bitmapFontData != null) { data = parameter.bitmapFontData; return deps; } data = new BitmapFontData(file, parameter != null && parameter.flip); if (parameter != null && parameter.atlasName != null) { deps.add(new AssetDescriptor(parameter.atlasName, TextureAtlas.class)); } else { for (int i = 0; i < data.getImagePaths().length; i++) { String path = data.getImagePath(i); FileHandle resolved = resolve(path); TextureLoader.TextureParameter textureParams = new TextureLoader.TextureParameter(); if (parameter != null) { textureParams.genMipMaps = parameter.genMipMaps; textureParams.minFilter = parameter.minFilter; textureParams.magFilter = parameter.magFilter; } AssetDescriptor descriptor = new AssetDescriptor(resolved, Texture.class, textureParams); deps.add(descriptor); } } return deps; }
public static void setLineHeight(Label label, float height) { BitmapFont font = label.getStyle().font; BitmapFont.BitmapFontData copiedData = new BitmapFont.BitmapFontData(font.getData().fontFile, font.getData().flipped); copiedData.setLineHeight(height); Label.LabelStyle style = new Label.LabelStyle(new BitmapFont(copiedData, font.getRegion(), true), new Color(font.getColor())); label.setStyle(style); }
/** Creates a BitmapFont from a BMFont file, using the specified image for glyphs. Any image specified in the BMFont file is * ignored. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */ public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) { this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer); ownsTexture = true; }
/** Creates a BitmapFont with the glyphs relative to the specified region. If the region is null, the glyph textures are loaded * from the image file given in the font file. The {@link #dispose()} method will not dispose the region's texture in this * case! * @param region The texture region containing the glyphs. The glyphs must be relative to the lower left corner (ie, the region * should not be flipped). If the region is null the glyph images are loaded from the image path in the font file. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. */ public BitmapFont (FileHandle fontFile, TextureRegion region, boolean flip) { this(new BitmapFontData(fontFile, flip), region, true); }
static BitmapFont copyFont(BitmapFont font) { if(font == null) return new BitmapFont(); return new BitmapFont(new BitmapFont.BitmapFontData(font.getData().getFontFile(), false), font.getRegions(), font.usesIntegerPositions()); } private DefaultResources()
public FreeBitmapFont(VGame game, FreePaint paint) { super(new BitmapFontData(), new TextureRegion(), false); pageWidth=paint.getPageWidth(); updataSize(paint.getTextSize()); this.game = game; this.listener = game.var3dListener; this.paint = paint; setIsEmoji(paint.isEmoji()); }
/** Creates a BitmapFont from a BMFont file. The image file name is read from the BMFont file and the image is loaded from the * same directory. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. */ public BitmapFont (FileHandle fontFile, boolean flip) { this(new BitmapFontData(fontFile, flip), (TextureRegion)null, true); }
Array<TextureRegion> regions = skin.getRegions(regionName); if (regions != null) font = new BitmapFont(new BitmapFontData(fontFile, flip), regions, true); else { TextureRegion region = skin.optional(regionName, TextureRegion.class);
Array<TextureRegion> regions = skin.getRegions(regionName); if (regions != null) font = new BitmapFont(new BitmapFontData(fontFile, flip), regions, true); else { TextureRegion region = skin.optional(regionName, TextureRegion.class);
@Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, BitmapFontParameter parameter) { Array<AssetDescriptor> deps = new Array(); if (parameter != null && parameter.bitmapFontData != null) { data = parameter.bitmapFontData; return deps; } data = new BitmapFontData(file, parameter != null && parameter.flip); if (parameter != null && parameter.atlasName != null) { deps.add(new AssetDescriptor(parameter.atlasName, TextureAtlas.class)); } else { for (int i = 0; i < data.getImagePaths().length; i++) { String path = data.getImagePath(i); FileHandle resolved = resolve(path); TextureLoader.TextureParameter textureParams = new TextureLoader.TextureParameter(); if (parameter != null) { textureParams.genMipMaps = parameter.genMipMaps; textureParams.minFilter = parameter.minFilter; textureParams.magFilter = parameter.magFilter; } AssetDescriptor descriptor = new AssetDescriptor(resolved, Texture.class, textureParams); deps.add(descriptor); } } return deps; }
@Override public Array<AssetDescriptor> getDependencies (String fileName, FileHandle file, BitmapFontParameter parameter) { Array<AssetDescriptor> deps = new Array(); if (parameter != null && parameter.bitmapFontData != null) { data = parameter.bitmapFontData; return deps; } data = new BitmapFontData(file, parameter != null && parameter.flip); if (parameter != null && parameter.atlasName != null) { deps.add(new AssetDescriptor(parameter.atlasName, TextureAtlas.class)); } else { for (int i = 0; i < data.getImagePaths().length; i++) { String path = data.getImagePath(i); FileHandle resolved = resolve(path); TextureLoader.TextureParameter textureParams = new TextureLoader.TextureParameter(); if (parameter != null) { textureParams.genMipMaps = parameter.genMipMaps; textureParams.minFilter = parameter.minFilter; textureParams.magFilter = parameter.magFilter; } AssetDescriptor descriptor = new AssetDescriptor(resolved, Texture.class, textureParams); deps.add(descriptor); } } return deps; }
/** Creates a BitmapFont from a BMFont file. The image file name is read from the BMFont file and the image is loaded from the * same directory. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. */ public BitmapFont (FileHandle fontFile, boolean flip) { this(new BitmapFontData(fontFile, flip), (TextureRegion)null, true); }
/** Creates a BitmapFont from a BMFont file, using the specified image for glyphs. Any image specified in the BMFont file is * ignored. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */ public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) { this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer); ownsTexture = true; }
/** Creates a BitmapFont with the glyphs relative to the specified region. If the region is null, the glyph textures are loaded * from the image file given in the font file. The {@link #dispose()} method will not dispose the region's texture in this * case! * @param region The texture region containing the glyphs. The glyphs must be relative to the lower left corner (ie, the region * should not be flipped). If the region is null the glyph images are loaded from the image path in the font file. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. */ public BitmapFont (FileHandle fontFile, TextureRegion region, boolean flip) { this(new BitmapFontData(fontFile, flip), region, true); }
/** Creates a BitmapFont from a BMFont file, using the specified image for glyphs. Any image specified in the BMFont file is * ignored. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. * @param integer If true, rendering positions will be at integer values to avoid filtering artifacts. */ public BitmapFont (FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) { this(new BitmapFontData(fontFile, flip), new TextureRegion(new Texture(imageFile, false)), integer); ownsTexture = true; }
/** Creates a BitmapFont with the glyphs relative to the specified region. If the region is null, the glyph textures are loaded * from the image file given in the font file. The {@link #dispose()} method will not dispose the region's texture in this * case! * @param region The texture region containing the glyphs. The glyphs must be relative to the lower left corner (ie, the region * should not be flipped). If the region is null the glyph images are loaded from the image path in the font file. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. */ public BitmapFont (FileHandle fontFile, TextureRegion region, boolean flip) { this(new BitmapFontData(fontFile, flip), region, true); }
/** Creates a BitmapFont from a BMFont file. The image file name is read from the BMFont file and the image is loaded from the * same directory. * @param flip If true, the glyphs will be flipped for use with a perspective where 0,0 is the upper left corner. */ public BitmapFont (FileHandle fontFile, boolean flip) { this(new BitmapFontData(fontFile, flip), (TextureRegion)null, true); }