java.lang.Object
de.gurkenlabs.litiengine.graphics.emitters.particles.Particle
de.gurkenlabs.litiengine.graphics.emitters.particles.TextParticle
All Implemented Interfaces:
ITimeToLive

public class TextParticle extends Particle
Represents a particle that renders text.
  • Constructor Details

    • TextParticle

      public TextParticle(String text)
      Constructs a TextParticle with the specified text.
      Parameters:
      text - The text to be rendered by this particle.
  • Method Details

    • getFont

      public Font getFont()
      Gets the font used by this TextParticle.
      Returns:
      The font used by this TextParticle.
    • getText

      public String getText()
      Gets the text rendered by this TextParticle.
      Returns:
      The text rendered by this TextParticle.
    • render

      public void render(Graphics2D g, Point2D emitterOrigin)
      Renders the text particle.
      Specified by:
      render in class Particle
      Parameters:
      g - The graphics context.
      emitterOrigin - The origin point of the emitter.
    • setFont

      public void setFont(Font font)
      Sets the font for this TextParticle.
      Parameters:
      font - The font to set.
    • getBoundingBox

      public Rectangle2D getBoundingBox(Point2D origin)
      Gets the bounding box of the text particle.
      Overrides:
      getBoundingBox in class Particle
      Parameters:
      origin - The origin point.
      Returns:
      The bounding box of the text particle.