title: How to extend Actor and draw it on stage? Libgdx
body: <p>I am trying to make an object that extends the Actor class. but whenever I have call the Stage's draw() method, it only draws the button I added to it. Here is my code, maybe someone here can help me?</p>
  
  <p>Code for my Screen class (Assume that I had overridden all necessary methods and that I imported all necessary classes):
  public class PlayScreen implements Screen{</p>
  
  <pre><code>SpriteBatch batch;
  Game game;
  Table table;
  Skin skin;
  Stage stage;
  BitmapFont font;
  TextButton button;
  TextDisplay display;
  
  
  public PlayScreen(MyGdxGame game, SpriteBatch batch){
  
      this.game = game;
      this.batch = batch;
  
      //instantiating Stage, Table, BitmapFont, and Skin objects.
      font = new BitmapFont(Gdx.files.internal("MyTruefont.fnt"));
      table = new Table();
      stage = new Stage();
      skin = new Skin(Gdx.files.internal("Test.json"));
  
  
      button = new TextButton("Start!", skin, "default");
      display = new TextDisplay(font, this);
  
      //Setting table properties
      table.setWidth(stage.getWidth());
      table.align(Align.center|Align.top);
      table.setPosition(0, Gdx.graphics.getHeight());
      table.padTop(30);
  
      //Adding actors to table
      table.add(button).padBottom(50);
      table.add(display);
  
      //Adding table to stage and setting stage as the input processor
      stage.addActor(table);
      Gdx.input.setInputProcessor(stage);
  }
  
  
  
  @Override
  public void show() {
  
  }
  
  @Override
  public void render(float delta) {
  
      Gdx.gl.glClearColor(1, 0, 0, 1);
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
      batch.begin();
      stage.draw();
      batch.end();
  }
  </code></pre>
  
  <p>And here is My Textdisplay class that extends Actor (Again assume all other methods have been overriden, and all necessary classes have been imported):</p>
  
  <pre><code>public class TextDisplay extends Actor implements Drawable {
  
      Texture texture;
      BitmapFont font;
      String str;
  
      public TextDisplay(BitmapFont font, Screen screen){
          this.font = font;
  
          texture = new Texture(Gdx.files.internal("TextArea.png"));
  
          str = "";
  
          setLeftWidth(texture.getWidth());
          setRightWidth(texture.getWidth());
  
          setBottomHeight(texture.getHeight());
          setTopHeight(texture.getHeight());
      }
  
  
  
  @Override
  public void draw(Batch batch, float x, float y, float width, float height) {
      batch.draw(texture, x, y);
  }
  </code></pre>