Interface StageVisitor


public interface StageVisitor
Visitor interface that can be used to traverse all nodes currently on the stage. Nodes are visited in the order in which they should be drawn, with parent nodes visited before their children. The renderer uses this interface to draw the graphics on stage after each frame update.
  • Method Details

    • prepareStage

      void prepareStage(Stage stage)
      Prepares visiting the stage. This method is called before any of the stage's graphics are visited. It can be used to add initialization logic that should be performed before any graphics can be drawn.
    • shouldVisitAllNodes

      boolean shouldVisitAllNodes()
      Indicates whether this visitor should visit all graphics, or only graphics that are currently visible.
    • visitContainer

      void visitContainer(Container container, Transform globalTransform)
    • drawBackground

      void drawBackground(ColorRGB color)
    • drawSprite

      void drawSprite(Sprite sprite, Transform globalTransform)
    • drawLine

      void drawLine(Primitive graphic, Line line, Transform globalTransform)
    • drawSegmentedLine

      void drawSegmentedLine(Primitive graphic, SegmentedLine line, Transform globalTransform)
    • drawRect

      void drawRect(Primitive graphic, Rect rect, Transform globalTransform)
    • drawCircle

      void drawCircle(Primitive graphic, Circle circle, Transform globalTransform)
    • drawPolygon

      void drawPolygon(Primitive graphic, Polygon polygon, Transform globalTransform)
    • drawText

      void drawText(Text text, Transform globalTransform)
    • finalize2D

      default void finalize2D(Stage stage)
      Called after all 2D nodes on the stage have been visited. This is an optional method, the default implementation is empty.
    • visitGroup

      void visitGroup(Group group, Transform3D globalTransform)
    • drawMesh

      void drawMesh(Mesh mesh, Transform3D globalTransform)
    • drawLight

      void drawLight(Light light, Transform3D globalTransform)
    • finalize3D

      default void finalize3D(Stage stage)
      Called after all 3D nodes on the stage have been visited, but before the 2D nodes are visited. This allows renders that support both 2D and 3D graphics to switch from rendering 3D graphics to rendering 2D graphics. This is an optional method, the default implementation is empty.