Class GlyphActor
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.github.yellowstonegames.glyph.GlyphActor
public class GlyphActor
extends com.badlogic.gdx.scenes.scene2d.Actor
A simple Actor that carries with it just one
long of glyph info and a Font to show that glyph with.
You can slide, scale, or rotate this like any other Actor, often using
Actions or the expansions in MoreActions.-
Field Summary
FieldsFields inherited from class com.badlogic.gdx.scenes.scene2d.Actor
POOLS -
Constructor Summary
ConstructorsConstructorDescriptionGlyphActor(char c, int color, com.github.tommyettinger.textra.Font f) GlyphActor(char c, com.github.tommyettinger.textra.Font f) GlyphActor(char c, String markup, com.github.tommyettinger.textra.Font f) GlyphActor(long g, com.github.tommyettinger.textra.Font f) GlyphActor(String markup, com.github.tommyettinger.textra.Font f) You should usually use this constructor if you want to place an inline image (such as an emoji) as a GlyphActor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha) chargetChar()com.badlogic.gdx.graphics.ColorgetColor()com.github.tommyettinger.textra.FontgetFont()longgetGlyph()com.github.yellowstonegames.grid.CoordvoidsetChar(char c) voidsetColor(float r, float g, float b, float a) voidsetColor(int color) voidsetColor(com.badlogic.gdx.graphics.Color color) voidsetFont(com.github.tommyettinger.textra.Font font) voidsetGlyph(long glyph) voidsetLocation(com.github.yellowstonegames.grid.Coord location) voidsetWithMarkup(String markup) You can set the complete glyph here using markup, including the possibility of setting the glyph to an inline image (such as an emoji) using the[+🤴🏽]syntax.Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
act, addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, hit, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront, toString
-
Field Details
-
glyph
public long glyph -
font
public com.github.tommyettinger.textra.Font font
-
-
Constructor Details
-
GlyphActor
public GlyphActor() -
GlyphActor
public GlyphActor(long g, com.github.tommyettinger.textra.Font f) -
GlyphActor
public GlyphActor(char c, com.github.tommyettinger.textra.Font f) -
GlyphActor
public GlyphActor(char c, int color, com.github.tommyettinger.textra.Font f) -
GlyphActor
-
GlyphActor
You should usually use this constructor if you want to place an inline image (such as an emoji) as a GlyphActor.- Parameters:
markup- must contain at least one char that will be displayed; you can use[+🤴🏽]syntax to enter an emoji, if supportedf- a Font, which should have had images added to it if you want to show inline images
-
-
Method Details
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha) - Overrides:
drawin classcom.badlogic.gdx.scenes.scene2d.Actor
-
setColor
public void setColor(int color) -
setColor
public void setColor(com.badlogic.gdx.graphics.Color color) - Overrides:
setColorin classcom.badlogic.gdx.scenes.scene2d.Actor
-
setColor
public void setColor(float r, float g, float b, float a) - Overrides:
setColorin classcom.badlogic.gdx.scenes.scene2d.Actor
-
getColor
public com.badlogic.gdx.graphics.Color getColor()- Overrides:
getColorin classcom.badlogic.gdx.scenes.scene2d.Actor
-
getChar
public char getChar() -
setChar
public void setChar(char c) -
getGlyph
public long getGlyph() -
setGlyph
public void setGlyph(long glyph) -
setWithMarkup
You can set the complete glyph here using markup, including the possibility of setting the glyph to an inline image (such as an emoji) using the[+🤴🏽]syntax.- Parameters:
markup- a markup String using square-bracket markup; must have at least one visible char
-
getFont
public com.github.tommyettinger.textra.Font getFont() -
setFont
public void setFont(com.github.tommyettinger.textra.Font font) -
getLocation
public com.github.yellowstonegames.grid.Coord getLocation() -
setLocation
public void setLocation(com.github.yellowstonegames.grid.Coord location)
-