playn.java
Class JavaGraphics

java.lang.Object
  extended by playn.core.gl.GraphicsGL
      extended by playn.java.JavaGraphics
All Implemented Interfaces:
Graphics

public class JavaGraphics
extends GraphicsGL


Field Summary
protected  Map<String,Font> _fonts
           
 
Constructor Summary
JavaGraphics(JavaPlatform platform, JavaPlatform.Config config)
           
 
Method Summary
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  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)
          Deprecated. 
 
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
 

Field Detail

_fonts

protected Map<String,Font> _fonts
Constructor Detail

JavaGraphics

public JavaGraphics(JavaPlatform platform,
                    JavaPlatform.Config config)
Method Detail

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

@Deprecated
public void setSize(int width,
                               int height)
Deprecated. 


gl20

public GL20 gl20()

ctx

public GLContext ctx()

createStaticImage

protected playn.java.JavaImage createStaticImage(BufferedImage source,
                                                 Scale scale)

createAsyncImage

protected JavaAsyncImage createAsyncImage(float width,
                                          float height)


Copyright © 2012. All Rights Reserved.