Package nl.colorize.multimedialib.stage
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 Primitive
s,
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 Summary
Modifier and TypeMethodDescriptionvoid
drawBackground
(ColorRGB color) void
drawCircle
(Primitive graphic, Circle circle) void
void
drawPolygon
(Primitive graphic, Polygon polygon) void
void
drawSegmentedLine
(Primitive graphic, SegmentedLine line) void
drawSprite
(Sprite sprite) void
void
prepareStage
(Stage stage) Prepares visiting the stage.boolean
Indicates whether this visitor should visit all graphics, or only graphics that are currently visible.void
visitContainer
(Container container) Visits a container.
-
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. -
shouldVisitAllGraphics
boolean shouldVisitAllGraphics()Indicates whether this visitor should visit all graphics, or only graphics that are currently visible. -
visitContainer
Visits a container. This method does not actually need to draw the container's graphics, since the correspondingdrawX
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
-
drawSprite
-
drawLine
-
drawSegmentedLine
-
drawRect
-
drawCircle
-
drawPolygon
-
drawText
-