Class TeaRenderer
- java.lang.Object
-
- nl.colorize.multimedialib.renderer.teavm.TeaRenderer
-
- All Implemented Interfaces:
Renderer,AnimationFrameCallback,org.teavm.jso.JSObject
public class TeaRenderer extends java.lang.Object implements Renderer, AnimationFrameCallback
Renderer based on TeaVM (http://teavm.org) that is transpiled to JavaScript and runs in the browser.
-
-
Constructor Summary
Constructors Constructor Description TeaRenderer(Canvas canvas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRenderCallback(Renderable callback)voidaddUpdateCallback(Updatable callback)ApplicationDatagetApplicationData(java.lang.String appName)CanvasgetCanvas()InputDevicegetInputDevice()InternetAccessgetInternetAccess()MediaLoadergetMediaLoader()nl.colorize.util.PlatformFamilygetPlatform()Returns the display name of the current platform.voidonRenderFrame()voidrequireMediaLoadingComplete()Requires all media to be fully loaded before the renderer starts the animation loop.java.lang.StringtakeScreenshot()Takes a screenshots of the renderer's current graphics, and saves it to an image.
-
-
-
Constructor Detail
-
TeaRenderer
public TeaRenderer(Canvas canvas)
-
-
Method Detail
-
getInputDevice
public InputDevice getInputDevice()
- Specified by:
getInputDevicein interfaceRenderer
-
getMediaLoader
public MediaLoader getMediaLoader()
- Specified by:
getMediaLoaderin interfaceRenderer
-
getApplicationData
public ApplicationData getApplicationData(java.lang.String appName)
- Specified by:
getApplicationDatain interfaceRenderer
-
getInternetAccess
public InternetAccess getInternetAccess()
- Specified by:
getInternetAccessin interfaceRenderer
-
addUpdateCallback
public void addUpdateCallback(Updatable callback)
- Specified by:
addUpdateCallbackin interfaceRenderer
-
addRenderCallback
public void addRenderCallback(Renderable callback)
- Specified by:
addRenderCallbackin interfaceRenderer
-
onRenderFrame
public void onRenderFrame()
- Specified by:
onRenderFramein interfaceAnimationFrameCallback
-
requireMediaLoadingComplete
public void requireMediaLoadingComplete()
Requires all media to be fully loaded before the renderer starts the animation loop. The browser loads media files asynchronously, so by default the animation loop is already active at a time when not all media files have been fully loaded yet.
-
getPlatform
public nl.colorize.util.PlatformFamily getPlatform()
Returns the display name of the current platform. This method is similar toPlatform.getPlatformName(), but detects the platform based on the browser'sUser-Agentheader rather than from the system properties.- Specified by:
getPlatformin interfaceRenderer
-
takeScreenshot
public java.lang.String takeScreenshot()
Description copied from interface:RendererTakes a screenshots of the renderer's current graphics, and saves it to an image. The image is returned as a data URL for a PNG image.- Specified by:
takeScreenshotin interfaceRenderer
-
-