public static class Font.GlyphRegion
extends com.badlogic.gdx.graphics.g2d.TextureRegion
| Modifier and Type | Field and Description |
|---|---|
float |
offsetX
The offset from the left of the original image to the left of the packed image, after whitespace was removed
for packing.
|
float |
offsetY
The offset from the bottom of the original image to the bottom of the packed image, after whitespace was
removed for packing.
|
float |
xAdvance
How far to move the "cursor" to the right after drawing this GlyphRegion.
|
| Constructor and Description |
|---|
GlyphRegion(Font.GlyphRegion other)
Copies another GlyphRegion.
|
GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion atlasRegion)
Creates a GlyphRegion from a parent TextureAtlas.AtlasRegion (almost always from an atlas).
|
GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureRegion textureRegion)
Creates a GlyphRegion from a parent TextureRegion (typically from an atlas).
|
GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureRegion textureRegion,
float offsetX,
float offsetY,
float xAdvance)
Creates a GlyphRegion from a parent TextureRegion (typically from an atlas), along with any offsets to use
for its x and y coordinates, and the amount of horizontal space to move over when this is drawn.
|
GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureRegion textureRegion,
int x,
int y,
int width,
int height)
Creates a GlyphRegion from a parent TextureRegion (typically from an atlas), along with the lower-left x and
y coordinates, the width, and the height of the GlyphRegion.
|
| Modifier and Type | Method and Description |
|---|---|
void |
flip(boolean x,
boolean y)
Flips the region, adjusting the offset so the image appears to be flipped as if no whitespace has been
removed for packing.
|
getRegionHeight, getRegionWidth, getRegionX, getRegionY, getTexture, getU, getU2, getV, getV2, isFlipX, isFlipY, scroll, setRegion, setRegion, setRegion, setRegion, setRegion, setRegionHeight, setRegionWidth, setRegionX, setRegionY, setTexture, setU, setU2, setV, setV2, split, splitpublic float offsetX
public float offsetY
public float xAdvance
offsetX.public GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureRegion textureRegion)
TextureRegion.getRegionWidth().textureRegion - a TextureRegion to draw for this GlyphRegion, typically from a TextureAtlaspublic GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion atlasRegion)
TextureAtlas.AtlasRegion.originalWidth.atlasRegion - a TextureAtlas.AtlasRegion to draw for this GlyphRegion, typically from a TextureAtlaspublic GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureRegion textureRegion,
float offsetX,
float offsetY,
float xAdvance)
textureRegion - a TextureRegion to draw for this GlyphRegion, typically from a TextureAtlasoffsetX - how many pixels to shift over the TextureRegion when drawn; positive is to the rightoffsetY - how many pixels to shift over the TextureRegion when drawn; positive is upwardsxAdvance - how much horizontal space the GlyphRegion should use up when drawnpublic GlyphRegion(com.badlogic.gdx.graphics.g2d.TextureRegion textureRegion,
int x,
int y,
int width,
int height)
textureRegion - a TextureRegion, typically from a TextureAtlasx - the x-coordinate of the left side of the texture, in pixelsy - the y-coordinate of the lower side of the texture, in pixelswidth - the width of the GlyphRegion, in pixelsheight - the height of the GlyphRegion, in pixelspublic GlyphRegion(Font.GlyphRegion other)
other - the other GlyphRegion to copypublic void flip(boolean x,
boolean y)
flip in class com.badlogic.gdx.graphics.g2d.TextureRegionx - true if this should flip x to be -xy - true if this should flip y to be -y