public class WZText extends Object
WZText
class can be used to display text as an overlay on a WZCameraView
Modifier and Type | Field and Description |
---|---|
static int |
BOTTOM
A position specifier for use as the second argument to
setPosition(int, int) to
align the text along the bottom of the display. |
static int |
CENTER
A position specifier for use with
setPosition(int, int) to
center the text within the device display. |
static int |
LEFT
A position specifier for use as the first argument to
setPosition(int, int) to
align the text along the left hand side of the display. |
static int |
RIGHT
A position specifier for use as the first argument to
setPosition(int, int) to
align the text along the right hand side of the display. |
static int |
TOP
A position specifier for use as the second argument to
setPosition(int, int) to
align the text along the top of the display. |
Modifier and Type | Method and Description |
---|---|
int |
getAlignment()
Returns the current position, in display pixels
|
float |
getAscent()
Return the scaled font ascent
|
WZSize |
getBaseSize()
Returns the original, unscaled size of the text being rendered
|
float |
getCharHeight()
Get the scaled character height
|
float |
getCharWidth(char chr)
Get the scaled width of the specified character
|
float |
getCharWidthMax()
Get the scaled maximum character width
|
WZColor |
getColor() |
float |
getDescent()
Return the scaled font descent
|
WZTextManager.Font |
getFont() |
UUID |
getFontId() |
int |
getHeight()
Get the scaled height of this text object
|
WZPoint |
getPosition() |
int |
getRotationAngle()
Returns the current rotation angle, in degrees
|
float |
getScale()
Returns the current scale factor
|
int |
getScaleBasis()
Returns the current method used for applying the scale factor
|
WZSize |
getScaledSize()
Returns the scaled size of the text object being rendered (i.e.
|
float |
getSpacing()
Get the spacing between characters
|
String |
getText() |
int |
getWidth()
Get the scaled width of this text object
|
boolean |
isVisible()
Indicates if the bitmap is being rendered (i.e.
|
void |
setAlignment(int alignment) |
void |
setColor(float r,
float g,
float b) |
void |
setColor(float r,
float g,
float b,
float a) |
void |
setColor(WZColor color) |
void |
setFontId(UUID fontId) |
void |
setPosition(int xpos,
int ypos)
Set the bitmap's display position
|
void |
setPosition(WZPoint position)
Set the bitmap's display position
|
void |
setRotationAngle(int angle)
Set the display rotation angle of the bitmap
|
void |
setScale(float scale)
Set the display scale factor for the bitmap based on it's original size
|
void |
setScale(float scale,
int scaleBasis)
Set the display scale factor and scaling basis for the bitmap
|
void |
setSpacing(float spacing)
Set the spacing between characters
|
void |
setText(String text) |
void |
setVisible(boolean isVisible)
Set a flag indicating whether the bitmap should be rendered (i.e.
|
public static final int CENTER
setPosition(int, int)
to
center the text within the device display.public static final int LEFT
setPosition(int, int)
to
align the text along the left hand side of the display.public static final int RIGHT
setPosition(int, int)
to
align the text along the right hand side of the display.public static final int TOP
setPosition(int, int)
to
align the text along the top of the display.public static final int BOTTOM
setPosition(int, int)
to
align the text along the bottom of the display.public String getText()
public void setText(String text)
public UUID getFontId()
public void setFontId(UUID fontId)
public WZTextManager.Font getFont()
public WZColor getColor()
public void setColor(WZColor color)
public void setColor(float r, float g, float b, float a)
public void setColor(float r, float g, float b)
public WZSize getBaseSize()
public WZSize getScaledSize()
public int getWidth()
public int getHeight()
public int getScaleBasis()
public float getScale()
public void setScale(float scale)
scale
- The scale factorpublic void setScale(float scale, int scaleBasis)
scale
- The scale factorscaleBasis
- One of WZTextManager.SCALE_BASIS_FRAME_WIDTH
, WZTextManager.SCALE_BASIS_FRAME_HEIGHT
,
WZTextManager.SCALE_BASIS_BASE_SIZE
, or WZTextManager.SCALE_BASIS_CURRENT_SIZE
public float getSpacing()
public void setSpacing(float spacing)
spacing
- the spacing between characterspublic void setPosition(WZPoint position)
position
- The display position, in display pixelspublic void setPosition(int xpos, int ypos)
xpos
- The x position, in display pixelsypos
- The y position, in display pixelspublic int getAlignment()
public void setAlignment(int alignment)
public int getRotationAngle()
public void setRotationAngle(int angle)
angle
- The display rotation angle, in degrees (0-360)public void setVisible(boolean isVisible)
isVisible
- true if the bitma should be rendered, false otherwisepublic boolean isVisible()
public float getCharWidth(char chr)
chr
- the character whose width to returnpublic float getCharWidthMax()
public float getCharHeight()
public float getAscent()
public float getDescent()
public WZPoint getPosition()
© 2016 Wowza Media Systems, LLC. All rights reserved. Terms | Privacy | Trademarks | Legal