Interface Renderer
-
- All Known Implementing Classes:
GDXRenderer,HeadlessRenderer,Java2DRenderer,TeaRenderer
public interface RendererThe renderer acts as the entry point for accessing platform-specific behavior such as running the animation loop, displaying 2D and 3D graphics, playing audio, and capturing user input from input devices.When started, the renderer will create the display system and then start the animation loop. Frame updates will be scheduled to match the desired framerate, although this might not be possible depending on the current platform and the amount and complexity of graphics that are drawn.
All interaction with the renderer should be done from callbacks that are called every frame during the animation loop, represented by
RenderCallback.For 3D graphics, the renderer will draw all objects that are part of the stage. Note that some renderer implementations may be limited to 2D graphics and do not support 3D graphics. The capabilities of the renderer and platform can be checked using
getSupportedGraphicsMode().For 2D graphics, the renderer does not use the concept of a stage: all 2D graphics are directly drawn to the screen during each frame. The
Graphic2Dinterface can be used to implement objects that will draw 2D graphics.The renderer has two concepts of display size: the screen and the canvas. This difference exists to allow applications to support multiple resolutions that may be different from the native screen resolution. The resolution at which the graphics are rendered is referred to as the canvas.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidattach(RenderCallback callback)ApplicationDatagetApplicationData(java.lang.String appName)CanvasgetCanvas()InputDevicegetInputDevice()InternetAccessgetInternetAccess()MediaLoadergetMediaLoader()nl.colorize.util.PlatformFamilygetPlatform()StagegetStage()GraphicsModegetSupportedGraphicsMode()voidstart()java.lang.StringtakeScreenshot()Takes a screenshots of the renderer's current graphics, and saves it to an image.
-
-
-
Method Detail
-
attach
void attach(RenderCallback callback)
-
start
void start()
-
getSupportedGraphicsMode
GraphicsMode getSupportedGraphicsMode()
-
getCanvas
Canvas getCanvas()
-
getStage
Stage getStage()
-
getInputDevice
InputDevice getInputDevice()
-
getMediaLoader
MediaLoader getMediaLoader()
-
getApplicationData
ApplicationData getApplicationData(java.lang.String appName)
-
getInternetAccess
InternetAccess getInternetAccess()
-
takeScreenshot
java.lang.String takeScreenshot()
Takes 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.
-
getPlatform
nl.colorize.util.PlatformFamily getPlatform()
-
-