Class TextParticle

All Implemented Interfaces:
Collidable

public class TextParticle extends Particle
Particle that shows a text, that can be specified via setText(String)
Author:
Angelo Aracri
  • Constructor Details

    • TextParticle

      public TextParticle()
      Create a TextParticle with standard font.
    • TextParticle

      public TextParticle(int fontSize)
      Create a TextParticle and set font size.
      Parameters:
      fontSize - the font size
  • Method Details

    • setText

      public void setText(String text)
      Setter for the internally used text that will be rendered.
      Parameters:
      text - the text.
    • setSize

      public void setSize(int size)
      Setter for the internally used font size.
      Parameters:
      size - the font size.
    • internalRender

      public void internalRender(GameGrid f)
      Description copied from class: GameElement

      Template method that will be called periodically after being added to a IScene. Must be as performant as possible to keep the FPS low, since it will be called in every render-loop.

      Should be overwritten in sub classes for custom visualization using the GameGrid.

      Overrides:
      internalRender in class Particle
      Parameters:
      f - the GameGrid that represents the games field and supplies primitive drawing operations.
    • create

      public TextParticle create()
      Description copied from class: Particle
      Create a particle.
      Overrides:
      create in class Particle
      Returns:
      a new particle