Interface StageVisitor

All Known Subinterfaces:
TeaGraphics
All Known Implementing Classes:
GDXGraphics, HtmlCanvasGraphics, Java2DGraphicsContext, JFXGraphics, PixiGraphics, ThreeGraphics, WebGL

public interface StageVisitor
Visitor interface that visits all graphics currently on the stage, visiting them in the order in which they should be drawn.

For the various drawX methods that operate on Primitives, the provided shape is already normalized to the position and size how it should be drawn on stage. In other words, the shape is defined using the coordinate system of the stage, not the coordinate system of the graphic or of its parent.

  • 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.
    • shouldVisitAllGraphics

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

      void visitContainer(Container container)
      Visits a container. This method does not actually need to draw the container's graphics, since the corresponding drawX methods will be called for all the container's children. This method will be called before the container's children are visited. It can be used to handle logic related to the container itself, for example to process children that were added or removed since the last frame update.
    • drawBackground

      void drawBackground(ColorRGB color)
    • drawSprite

      void drawSprite(Sprite sprite)
    • drawLine

      void drawLine(Primitive graphic, Line line)
    • drawSegmentedLine

      void drawSegmentedLine(Primitive graphic, SegmentedLine line)
    • drawRect

      void drawRect(Primitive graphic, Rect rect)
    • drawCircle

      void drawCircle(Primitive graphic, Circle circle)
    • drawPolygon

      void drawPolygon(Primitive graphic, Polygon polygon)
    • drawText

      void drawText(Text text)