public class AndroidGraphics extends Graphics
| Modifier and Type | Class and Description |
|---|---|
static interface |
AndroidGraphics.Refreshable
An interface implemented by entities that need to store things when our GL context is lost
and restore them when we are given a new context.
|
static interface |
AndroidGraphics.ScaleFunc
|
defaultRenderTarget, gl, viewSize| Constructor and Description |
|---|
AndroidGraphics(Platform plat,
android.graphics.Bitmap.Config bitmapConfig,
float scaleFactor) |
| Modifier and Type | Method and Description |
|---|---|
Canvas |
createCanvas(float width,
float height) |
TextLayout |
layoutText(String text,
TextFormat format) |
TextLayout[] |
layoutText(String text,
TextFormat format,
TextWrap wrap) |
void |
onSurfaceChanged(int pixelWidth,
int pixelHeight)
Informs the graphics system that the surface into which it is rendering has changed size.
|
void |
onSurfaceCreated()
Informs the graphics system that the surface into which it is rendering was created.
|
void |
onSurfaceLost()
Informs the graphics system that the surface into which it is rendering was lost.
|
void |
registerFont(android.graphics.Typeface face,
String name,
Font.Style style,
String... ligatureGlyphs)
Registers a font with the graphics system.
|
IDimension |
screenSize() |
void |
setCanvasFilterBitmaps(boolean filterBitmaps)
Configures the default bitmap filtering (smoothing) setting used when rendering images to a
canvas.
|
void |
setCanvasScaleFunc(AndroidGraphics.ScaleFunc scaleFunc)
Configures the scale factor function to use for
Canvas. |
createCanvas, createTexture, createTexture, queueForDispose, scalepublic AndroidGraphics(Platform plat, android.graphics.Bitmap.Config bitmapConfig, float scaleFactor)
public void registerFont(android.graphics.Typeface face,
String name,
Font.Style style,
String... ligatureGlyphs)
face - the typeface to be registered. It can be loaded via
AndroidAssets.getTypeface(java.lang.String).name - the name under which to register the font.style - the style variant of the specified name provided by the font file. For example
one might registerFont("myfont.ttf", "My Font", Font.Style.PLAIN) and
registerFont("myfontb.ttf", "My Font", Font.Style.BOLD) to provide both the plain and
bold variants of a particular font.ligatureGlyphs - any known text sequences that are converted into a single ligature
character in this font. This works around an Android bug where measuring text for wrapping
that contains character sequences that are converted into ligatures (e.g. "fi" or "ae")
incorrectly reports the number of characters "consumed" from the to-be-wrapped string.public void setCanvasFilterBitmaps(boolean filterBitmaps)
public void setCanvasScaleFunc(AndroidGraphics.ScaleFunc scaleFunc)
Canvas. By default we use the current
graphics scale factor, which provides maximum resolution. Apps running on memory constrained
devices may wish to lower to lower this scale factor to reduce memory usage for especially
large canvases.public void onSurfaceCreated()
public void onSurfaceChanged(int pixelWidth,
int pixelHeight)
public void onSurfaceLost()
public IDimension screenSize()
screenSize in class Graphicspublic Canvas createCanvas(float width, float height)
createCanvas in class Graphicspublic TextLayout layoutText(String text, TextFormat format)
layoutText in class Graphicspublic TextLayout[] layoutText(String text, TextFormat format, TextWrap wrap)
layoutText in class GraphicsCopyright © 2017. All Rights Reserved.