public class JavaGraphics extends GraphicsGL
| Constructor and Description |
|---|
JavaGraphics(JavaPlatform platform,
JavaPlatform.Config config) |
| Modifier and Type | Method and Description |
|---|---|
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) |
GL20Context |
ctx() |
GL20 |
gl20() |
TextLayout |
layoutText(String text,
TextFormat format) |
TextLayout[] |
layoutText(String text,
TextFormat format,
TextWrap wrap) |
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,
boolean fullscreen)
Changes the size of the PlayN window.
|
createGroupLayer, createGroupLayer, createImageLayer, createImageLayer, createImmediateLayer, createImmediateLayer, createSurface, 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,
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()
Copyright © 2015. All Rights Reserved.