playn.java
Class JavaGraphics
java.lang.Object
playn.java.JavaGraphics
- All Implemented Interfaces:
- Graphics
public class JavaGraphics
- extends Object
- implements Graphics
|
Method Summary |
CanvasLayer |
createCanvasLayer(int width,
int height)
Deprecated. |
Font |
createFont(String name,
Font.Style style,
float size)
|
GroupLayer |
createGroupLayer()
|
CanvasImage |
createImage(int w,
int h)
|
ImageLayer |
createImageLayer()
|
ImageLayer |
createImageLayer(Image image)
|
ImmediateLayer |
createImmediateLayer(ImmediateLayer.Renderer renderer)
|
ImmediateLayer.Clipped |
createImmediateLayer(int width,
int height,
ImmediateLayer.Renderer renderer)
|
Gradient |
createLinearGradient(float x0,
float y0,
float x1,
float y1,
int[] colors,
float[] positions)
|
Path |
createPath()
|
Pattern |
createPattern(Image img)
|
Gradient |
createRadialGradient(float x,
float y,
float r,
int[] colors,
float[] positions)
|
SurfaceLayer |
createSurfaceLayer(int width,
int height)
|
int |
height()
|
TextLayout |
layoutText(String text,
TextFormat format)
|
void |
registerFont(String name,
String path)
Registers a font with the graphics system. |
playn.java.JavaGroupLayer |
rootLayer()
|
int |
screenHeight()
|
int |
screenWidth()
|
void |
setSize(int width,
int height)
|
int |
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
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.
createCanvasLayer
@Deprecated
public CanvasLayer createCanvasLayer(int width,
int height)
- Deprecated.
- Specified by:
createCanvasLayer in interface Graphics
createGroupLayer
public GroupLayer createGroupLayer()
- Specified by:
createGroupLayer in interface Graphics
createImageLayer
public ImageLayer createImageLayer()
- Specified by:
createImageLayer in interface Graphics
createImageLayer
public ImageLayer createImageLayer(Image image)
- Specified by:
createImageLayer in interface Graphics
createSurfaceLayer
public SurfaceLayer createSurfaceLayer(int width,
int height)
- Specified by:
createSurfaceLayer in interface Graphics
createImmediateLayer
public ImmediateLayer.Clipped createImmediateLayer(int width,
int height,
ImmediateLayer.Renderer renderer)
- Specified by:
createImmediateLayer in interface Graphics
createImmediateLayer
public ImmediateLayer createImmediateLayer(ImmediateLayer.Renderer renderer)
- Specified by:
createImmediateLayer in interface Graphics
rootLayer
public playn.java.JavaGroupLayer rootLayer()
- Specified by:
rootLayer in interface Graphics
createImage
public CanvasImage createImage(int w,
int h)
- Specified by:
createImage in interface Graphics
createLinearGradient
public Gradient createLinearGradient(float x0,
float y0,
float x1,
float y1,
int[] colors,
float[] positions)
- Specified by:
createLinearGradient in interface Graphics
createPath
public Path createPath()
- Specified by:
createPath in interface Graphics
createPattern
public Pattern createPattern(Image img)
- Specified by:
createPattern in interface Graphics
createRadialGradient
public Gradient createRadialGradient(float x,
float y,
float r,
int[] colors,
float[] positions)
- Specified by:
createRadialGradient in interface Graphics
createFont
public Font createFont(String name,
Font.Style style,
float size)
- Specified by:
createFont in interface Graphics
layoutText
public TextLayout layoutText(String text,
TextFormat format)
- Specified by:
layoutText in interface Graphics
screenWidth
public int screenWidth()
- Specified by:
screenWidth in interface Graphics
screenHeight
public int screenHeight()
- Specified by:
screenHeight in interface Graphics
width
public int width()
- Specified by:
width in interface Graphics
height
public int height()
- Specified by:
height in interface Graphics
setSize
public void setSize(int width,
int height)
- Specified by:
setSize in interface Graphics
Copyright © 2012. All Rights Reserved.