Class JOGLTextRenderer2d

  • All Implemented Interfaces:
    ITextRenderer

    public class JOGLTextRenderer2d
    extends AbstractTextRenderer
    implements ITextRenderer
    Render 2D texts using JOGL TextRenderer. The text color is defined either by TextRenderer.setColor(java.awt.Color) or inside the implementation of TextRenderer.RenderDelegate.draw(java.awt.Graphics2D, String, int, int) if the TextRenderer is initialized with a non null TextRenderer.RenderDelegate. Note that Jzy3d and JOGL behave differently with text rendering
    • Jzy3d's text color is defined for each string.
    • JOGL's text color is defined globally and can not be changed consistently afterward if it uses a TextRenderer.RenderDelegate.
    Wrapping a JOGL text renderer hence requires recreating a new TextRenderer if the color of the strings changes.
    Author:
    Martin Pernollet
    • Field Detail

      • awtFont

        protected Font awtFont
      • renderer

        protected com.jogamp.opengl.util.awt.TextRenderer renderer
      • renderDelegate

        protected com.jogamp.opengl.util.awt.TextRenderer.RenderDelegate renderDelegate
      • scaleFactor

        protected float scaleFactor
    • Constructor Detail

      • JOGLTextRenderer2d

        public JOGLTextRenderer2d()
      • JOGLTextRenderer2d

        public JOGLTextRenderer2d​(Font font)
      • JOGLTextRenderer2d

        public JOGLTextRenderer2d​(Font font,
                                  com.jogamp.opengl.util.awt.TextRenderer.RenderDelegate renderDelegate)
        Parameters:
        font - text font, style and size.
        renderDelegate - may be null if no particular custom styling should be applied.