Class DistanceFieldFont

    • Method Detail

      • newFontCache

        public BitmapFontCache newFontCache()
        Description copied from class: BitmapFont
        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.

        Overrides:
        newFontCache in class BitmapFont
      • getDistanceFieldSmoothing

        public float getDistanceFieldSmoothing()
        Returns:
        The distance field smoothing factor for this font.
      • setDistanceFieldSmoothing

        public void setDistanceFieldSmoothing​(float distanceFieldSmoothing)
        Parameters:
        distanceFieldSmoothing - Set the distance field smoothing factor for this font. SpriteBatch needs to have this shader set for rendering distance field fonts.
      • createDistanceFieldShader

        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.