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

    Fields
    Modifier and Type
    Field
    Description
    com.github.tommyettinger.textra.Font
     
    long
     

    Fields inherited from class com.badlogic.gdx.scenes.scene2d.Actor

    POOLS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    GlyphActor(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 Type
    Method
    Description
    void
    draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
     
    char
     
    com.badlogic.gdx.graphics.Color
     
    com.github.tommyettinger.textra.Font
     
    long
     
    com.github.yellowstonegames.grid.Coord
     
    void
    setChar(char c)
     
    void
    setColor(float r, float g, float b, float a)
     
    void
    setColor(int color)
     
    void
    setColor(com.badlogic.gdx.graphics.Color color)
     
    void
    setFont(com.github.tommyettinger.textra.Font font)
     
    void
    setGlyph(long glyph)
     
    void
    setLocation(com.github.yellowstonegames.grid.Coord location)
     
    void
    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

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public GlyphActor(char c, String markup, com.github.tommyettinger.textra.Font f)
    • GlyphActor

      public 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.
      Parameters:
      markup - must contain at least one char that will be displayed; you can use [+🤴🏽] syntax to enter an emoji, if supported
      f - 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:
      draw in class com.badlogic.gdx.scenes.scene2d.Actor
    • setColor

      public void setColor(int color)
    • setColor

      public void setColor(com.badlogic.gdx.graphics.Color color)
      Overrides:
      setColor in class com.badlogic.gdx.scenes.scene2d.Actor
    • setColor

      public void setColor(float r, float g, float b, float a)
      Overrides:
      setColor in class com.badlogic.gdx.scenes.scene2d.Actor
    • getColor

      public com.badlogic.gdx.graphics.Color getColor()
      Overrides:
      getColor in class com.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

      public void setWithMarkup(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.
      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)