createDistanceFieldShader() shader.
Attention: The batch is flushed before and after each string is rendered.
| Modifier and Type | Class and Description |
|---|---|
| private static class | DistanceFieldFont.
Provides a font cache that uses distance field shader for rendering fonts. |
| Modifier and Type | Field and Description |
|---|---|
| private float |
| Access | Constructor and Description |
|---|---|
| public | DistanceFieldFont(BitmapFont.
|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static ShaderProgram | createDistanceFieldShader()
Returns a new instance of the distance field shader, see https://libgdx.com/wiki/graphics/2d/fonts/distance-field-fonts if the u_smoothing uniform > 0.0. |
| public float | |
| protected void | |
| public BitmapFontCache | newFontCache()
Overrides com. Creates a new BitmapFontCache for this font. |
| public void | setDistanceFieldSmoothing(float
Set the distance field smoothing factor for this font. SpriteBatch needs to have this shader
set for rendering distance field fonts. distanceFieldSmoothing)
|
| distanceFieldSmoothing | back to summary |
|---|---|
| private float distanceFieldSmoothing | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(BitmapFont. | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(BitmapFont. | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(FileHandle fontFile, boolean flip) | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(FileHandle fontFile, FileHandle imageFile, boolean flip, boolean integer) | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(FileHandle fontFile, FileHandle imageFile, boolean flip) | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(FileHandle fontFile, TextureRegion region, boolean flip) | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(FileHandle fontFile, TextureRegion region) | |
| DistanceFieldFont | back to summary |
|---|---|
| public DistanceFieldFont(FileHandle fontFile) | |
| createDistanceFieldShader | back to summary |
|---|---|
| public static ShaderProgram createDistanceFieldShader() Returns a new instance of the distance field shader, see https://libgdx.com/wiki/graphics/2d/fonts/distance-field-fonts if the u_smoothing uniform > 0.0. Otherwise the same code as the default SpriteBatch shader is used. | |
| getDistanceFieldSmoothing | back to summary |
|---|---|
public float getDistanceFieldSmoothing()
| |
| load | back to summary |
|---|---|
| protected void load(BitmapFont. | |
| newFontCache | back to summary |
|---|---|
| public BitmapFontCache newFontCache() Overrides com. Doc from com. Creates a new BitmapFontCache for this font. Using this method allows the font to provide the BitmapFontCache implementation to customize rendering. Note this method is called by the BitmapFont constructors. If a subclass overrides this method, it will be called before the subclass constructors.
| |
| setDistanceFieldSmoothing | back to summary |
|---|---|
public void setDistanceFieldSmoothing(float distanceFieldSmoothing)
| |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | draw(Batch spriteBatch, int start, int end)
Overrides com.
|
| private float | |
| private void |
| DistanceFieldFontCache | back to summary |
|---|---|
| public DistanceFieldFontCache(DistanceFieldFont font) | |
| DistanceFieldFontCache | back to summary |
|---|---|
| public DistanceFieldFontCache(DistanceFieldFont font, boolean integer) | |
| draw | back to summary |
|---|---|
| public void draw(Batch spriteBatch) Overrides com.
| |
| draw | back to summary |
|---|---|
| public void draw(Batch spriteBatch, int start, int end) Overrides com.
| |
| getSmoothingFactor | back to summary |
|---|---|
| private float getSmoothingFactor() | |
| setSmoothingUniform | back to summary |
|---|---|
| private void setSmoothingUniform(Batch spriteBatch, float smoothing) | |