Class HtmlCanvasGraphics
java.lang.Object
nl.colorize.multimedialib.renderer.teavm.HtmlCanvasGraphics
- All Implemented Interfaces:
TeaGraphics,StageVisitor
Renders graphics using the HTML canvas API. The current platform and browser
will influence which drawing operations are hardware-accelerated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancastPickRay(Point2D canvasPosition, Box area) createMesh(Shape3D shape, ColorRGB color) voiddrawBackground(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) voidintintorg.teavm.jso.dom.html.HTMLCanvasElementvoidinit(SceneContext sceneContext) 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) 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.StageVisitor
finalize2D, finalize3DMethods inherited from interface nl.colorize.multimedialib.renderer.teavm.TeaGraphics
getDevicePixelRatio
-
Constructor Details
-
HtmlCanvasGraphics
public HtmlCanvasGraphics()
-
-
Method Details
-
init
- Specified by:
initin interfaceTeaGraphics
-
getDisplayWidth
public int getDisplayWidth()- Specified by:
getDisplayWidthin interfaceTeaGraphics
-
getDisplayHeight
public int getDisplayHeight()- Specified by:
getDisplayHeightin interfaceTeaGraphics
-
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
-
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
-
drawBackground
- Specified by:
drawBackgroundin interfaceStageVisitor
-
drawSprite
- Specified by:
drawSpritein interfaceStageVisitor
-
drawLine
- Specified by:
drawLinein interfaceStageVisitor
-
drawSegmentedLine
- Specified by:
drawSegmentedLinein interfaceStageVisitor
-
drawRect
- Specified by:
drawRectin interfaceStageVisitor
-
drawCircle
- Specified by:
drawCirclein interfaceStageVisitor
-
drawPolygon
- Specified by:
drawPolygonin interfaceStageVisitor
-
drawText
- Specified by:
drawTextin interfaceStageVisitor
-
visitGroup
- Specified by:
visitGroupin interfaceStageVisitor
-
drawMesh
- Specified by:
drawMeshin interfaceStageVisitor
-
drawLight
- Specified by:
drawLightin interfaceStageVisitor
-
createMesh
- Specified by:
createMeshin interfaceTeaGraphics
-
project
- Specified by:
projectin interfaceTeaGraphics
-
castPickRay
- Specified by:
castPickRayin interfaceTeaGraphics
-
getGraphicsMode
- Specified by:
getGraphicsModein interfaceTeaGraphics
-
getHtmlCanvas
public org.teavm.jso.dom.html.HTMLCanvasElement getHtmlCanvas()
-