Class GDXGraphics
java.lang.Object
nl.colorize.multimedialib.renderer.libgdx.GDXGraphics
- All Implemented Interfaces:
StageSubscriber,StageVisitor
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGDXGraphics(GraphicsMode graphicsMode, Canvas canvas, GDXMediaLoader mediaLoader) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispose()voiddrawBackground(ColorRGB backgroundColor) voiddrawCircle(Primitive graphic, Circle circle, Transform globalTransform) voiddrawLight(Light light, Transform3D globalTransform) voidDraws a line using libGDX'sShapeBatch.voiddrawMesh(Mesh mesh, Transform3D globalTransform) voiddrawPolygon(Primitive graphic, Polygon polygon, Transform globalTransform) voidvoiddrawSegmentedLine(Primitive graphic, SegmentedLine line, Transform globalTransform) voiddrawSprite(Sprite sprite, Transform globalTransform) voidvoidfinalize2D(Stage stage) Called after all 2D nodes on the stage have been visited.voidfinalize3D(Stage stage) Called after all 3D nodes on the stage have been visited, but before the 2D nodes are visited.voidonNodeAdded(Group parent, StageNode3D node) voidonNodeRemoved(Group parent, StageNode3D node) voidprepareStage(Stage stage) Prepares visiting the stage.protected voidbooleanIndicates whether this visitor should visit all graphics, or only graphics that are currently visible.floattoScreenY(float y) voidvisitContainer(Container container, Transform globalTransform) voidvisitGroup(Group group, Transform3D globalTransform) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.colorize.multimedialib.stage.StageSubscriber
onNodeAdded, onNodeRemoved
-
Field Details
-
camera
protected com.badlogic.gdx.graphics.PerspectiveCamera camera
-
-
Constructor Details
-
GDXGraphics
-
-
Method Details
-
restartBatch
protected void restartBatch() -
prepareStage
Description copied from interface:StageVisitorPrepares 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.- Specified by:
prepareStagein interfaceStageVisitor
-
onNodeAdded
- Specified by:
onNodeAddedin interfaceStageSubscriber
-
onNodeRemoved
- Specified by:
onNodeRemovedin interfaceStageSubscriber
-
shouldVisitAllNodes
public boolean shouldVisitAllNodes()Description copied from interface:StageVisitorIndicates whether this visitor should visit all graphics, or only graphics that are currently visible.- Specified by:
shouldVisitAllNodesin interfaceStageVisitor
-
visitContainer
- Specified by:
visitContainerin interfaceStageVisitor
-
drawBackground
- Specified by:
drawBackgroundin interfaceStageVisitor
-
drawLine
Draws a line using libGDX'sShapeBatch. Drawing lines will always trigger a mode switch, as "line mode" and "fill mode" are separate and lines are the only shape without a fill.- Specified by:
drawLinein interfaceStageVisitor
-
drawSegmentedLine
- Specified by:
drawSegmentedLinein interfaceStageVisitor
-
drawRect
- Specified by:
drawRectin interfaceStageVisitor
-
drawCircle
- Specified by:
drawCirclein interfaceStageVisitor
-
drawPolygon
- Specified by:
drawPolygonin interfaceStageVisitor
-
drawSprite
- Specified by:
drawSpritein interfaceStageVisitor
-
drawText
- Specified by:
drawTextin interfaceStageVisitor
-
finalize2D
Description copied from interface:StageVisitorCalled after all 2D nodes on the stage have been visited. This is an optional method, the default implementation is empty.- Specified by:
finalize2Din interfaceStageVisitor
-
visitGroup
- Specified by:
visitGroupin interfaceStageVisitor
-
drawMesh
- Specified by:
drawMeshin interfaceStageVisitor
-
drawLight
- Specified by:
drawLightin interfaceStageVisitor
-
finalize3D
Description copied from interface:StageVisitorCalled 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.- Specified by:
finalize3Din interfaceStageVisitor
-
toScreenY
public float toScreenY(float y) -
dispose
protected void dispose()
-