Package nl.colorize.multimedialib.stage
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 Summary
Modifier and TypeMethodDescriptionvoiddrawBackground(ColorRGB color) voiddrawCircle(Primitive graphic, Circle circle, Transform globalTransform) voiddrawLight(Light light, Transform3D globalTransform) voidvoiddrawMesh(Mesh mesh, Transform3D globalTransform) voiddrawPolygon(Primitive graphic, Polygon polygon, Transform globalTransform) voidvoiddrawSegmentedLine(Primitive graphic, SegmentedLine line, Transform globalTransform) voiddrawSprite(Sprite sprite, Transform globalTransform) voiddefault voidfinalize2D(Stage stage) Called after all 2D nodes on the stage have been visited.default voidfinalize3D(Stage stage) Called after all 3D nodes on the stage have been visited, but before the 2D nodes are visited.voidprepareStage(Stage stage) Prepares visiting the stage.booleanIndicates whether this visitor should visit all graphics, or only graphics that are currently visible.voidvisitContainer(Container container, Transform globalTransform) voidvisitGroup(Group group, Transform3D globalTransform)
-
Method Details
-
prepareStage
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
-
drawBackground
-
drawSprite
-
drawLine
-
drawSegmentedLine
-
drawRect
-
drawCircle
-
drawPolygon
-
drawText
-
finalize2D
Called after all 2D nodes on the stage have been visited. This is an optional method, the default implementation is empty. -
visitGroup
-
drawMesh
-
drawLight
-
finalize3D
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.
-