public class JavaGraphics extends GraphicsGL
| Constructor and Description |
|---|
JavaGraphics(JavaPlatform platform,
JavaPlatform.Config config) |
| Modifier and Type | Method and Description |
|---|---|
protected JavaAsyncImage |
createAsyncImage(float width,
float height) |
Font |
createFont(String name,
Font.Style style,
float size) |
CanvasImage |
createImage(float width,
float height) |
Gradient |
createLinearGradient(float x0,
float y0,
float x1,
float y1,
int[] colors,
float[] positions) |
Gradient |
createRadialGradient(float x,
float y,
float r,
int[] colors,
float[] positions) |
protected JavaImage |
createStaticImage(BufferedImage source,
Scale scale) |
GL20Context |
ctx() |
GL20 |
gl20() |
TextLayout |
layoutText(String text,
TextFormat format) |
void |
registerFont(String name,
String path)
Registers a font with the graphics system.
|
GroupLayerGL |
rootLayer() |
int |
screenHeight() |
int |
screenWidth() |
void |
setSize(int width,
int height)
Changes the size of the PlayN window.
|
createGroupLayer, createGroupLayer, createImageLayer, createImageLayer, createImmediateLayer, createImmediateLayer, createSurface, createSurfaceGL, createSurfaceLayer, height, scaleFactor, widthpublic JavaGraphics(JavaPlatform platform, JavaPlatform.Config config)
public void registerFont(String name, String path)
name - the name under which to register the font.path - the path to the font resource (relative to the asset manager's path prefix).
Currently only TrueType (.ttf) fonts are supported.public void setSize(int width,
int height)
public GroupLayerGL rootLayer()
public CanvasImage createImage(float width, float height)
public Gradient createLinearGradient(float x0, float y0, float x1, float y1, int[] colors, float[] positions)
public Gradient createRadialGradient(float x, float y, float r, int[] colors, float[] positions)
public Font createFont(String name, Font.Style style, float size)
public TextLayout layoutText(String text, TextFormat format)
public int screenWidth()
public int screenHeight()
public GL20 gl20()
public GL20Context ctx()
protected JavaImage createStaticImage(BufferedImage source, Scale scale)
protected JavaAsyncImage createAsyncImage(float width, float height)
Copyright © 2013. All Rights Reserved.