playn.java
Class JavaGraphics
java.lang.Object
playn.core.gl.GraphicsGL
playn.java.JavaGraphics
- All Implemented Interfaces:
- Graphics
public class JavaGraphics
- extends GraphicsGL
|
Method Summary |
protected playn.java.JavaImage |
createErrorImage(Exception cause)
|
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 playn.java.JavaImage |
createStaticImage(BufferedImage source,
Scale scale)
|
GLContext |
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)
|
| Methods inherited from class playn.core.gl.GraphicsGL |
createGroupLayer, createGroupLayer, createImageLayer, createImageLayer, createImmediateLayer, createImmediateLayer, createSurface, createSurfaceLayer, height, scaleFactor, width |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_fonts
protected Map<String,Font> _fonts
JavaGraphics
public JavaGraphics(JavaPlatform platform,
float scaleFactor,
boolean headless)
registerFont
public void registerFont(String name,
String path)
- Registers a font with the graphics system.
- Parameters:
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.
rootLayer
public GroupLayerGL rootLayer()
createImage
public CanvasImage createImage(float width,
float height)
createLinearGradient
public Gradient createLinearGradient(float x0,
float y0,
float x1,
float y1,
int[] colors,
float[] positions)
createRadialGradient
public Gradient createRadialGradient(float x,
float y,
float r,
int[] colors,
float[] positions)
createFont
public Font createFont(String name,
Font.Style style,
float size)
layoutText
public TextLayout layoutText(String text,
TextFormat format)
screenWidth
public int screenWidth()
screenHeight
public int screenHeight()
setSize
public void setSize(int width,
int height)
- Specified by:
setSize in interface Graphics- Overrides:
setSize in class GraphicsGL
gl20
public GL20 gl20()
ctx
public GLContext ctx()
createStaticImage
protected playn.java.JavaImage createStaticImage(BufferedImage source,
Scale scale)
createErrorImage
protected playn.java.JavaImage createErrorImage(Exception cause)
Copyright © 2012. All Rights Reserved.