public class JavaGraphics extends GraphicsGL
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Font> |
_fonts |
protected GL20Context |
ctx |
protected JavaPlatform |
platform |
protected GroupLayerGL |
rootLayer |
| 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() |
protected void |
init() |
TextLayout |
layoutText(String text,
TextFormat format) |
TextLayout[] |
layoutText(String text,
TextFormat format,
TextWrap wrap) |
protected void |
paint() |
void |
registerFont(String name,
String path)
Registers a font with the graphics system.
|
GroupLayerGL |
rootLayer() |
int |
screenHeight() |
int |
screenWidth() |
protected void |
setDisplayMode(int width,
int height,
boolean fullscreen) |
void |
setSize(int width,
int height,
boolean fullscreen)
Changes the size of the PlayN window.
|
createGroupLayer, createGroupLayer, createImageLayer, createImageLayer, createImmediateLayer, createImmediateLayer, createSurface, createSurfaceGL, createSurfaceLayer, height, scaleFactor, widthprotected final JavaPlatform platform
protected final GL20Context ctx
protected final GroupLayerGL rootLayer
public 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,
boolean fullscreen)
protected void setDisplayMode(int width,
int height,
boolean fullscreen)
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 TextLayout[] layoutText(String text, TextFormat format, TextWrap wrap)
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)
protected void init()
protected void paint()
Copyright © 2013. All Rights Reserved.