title: LibGDX Stage and Actor, Events and Actor properties
body: <p>I'm just starting android game development with LibGdx framework.
  I read many online tutorial so far and the more I read the more I got confused: ApplicationListener, ApplicationAdapter, Stages, Game, Screens, Actors, Sprites, Images... not mentioning Input and Gesture listeners of all king).</p>
  
  <p>I finally understood what kind of "model" I should use for the game I have in mind (a kind of puzzle game): Game, Screens, Stage and Actor.</p>
  
  <p>So here is my first code.</p>
  
  <p>This is the main application (Game):</p>
  
  <pre><code>package com.my.game1;
  import com.badlogic.gdx.Game;
  
  public class MyGame extends Game {
  
      @Override
      public void create () {
          setScreen(new StarterScreen());
      } 
  }
  </code></pre>
  
  <p>This is the main screen class:</p>
  
  <pre><code>package com.my.game1;
  
  import com.badlogic.gdx.Gdx;
  import com.badlogic.gdx.Screen;
  import com.badlogic.gdx.graphics.GL20;
  import com.badlogic.gdx.scenes.scene2d.Stage;
  
  public class StarterScreen implements Screen {
  
      private Stage stage;
      private float screenW, screenH;
      private Tess tessera;
  
      @Override
      public void show() {
          tessera = new Tess("image.png");
          stage = new Stage();
          screenW = stage.getViewport().getWorldWidth();
          screenH = stage.getViewport().getWorldHeight();
          Gdx.input.setInputProcessor(stage);
          stage.addActor(tessera);
      }
  
      @Override
      public void render(float delta) {
          Gdx.gl.glClearColor(0,0,0,1);
          Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
          stage.act();
          stage.draw();
      }
  
      @Override
      public void resize(int width, int height) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void pause() {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void resume() {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void hide() {
          dispose();
      }
  
      @Override
      public void dispose() {
          stage.dispose();
      }  
  
  }
  </code></pre>
  
  <p>And the following is the class that extends Actor:</p>
  
  <pre><code>package com.my.game1;
  
  import com.badlogic.gdx.Gdx;
  import com.badlogic.gdx.graphics.Texture;
  import com.badlogic.gdx.graphics.g2d.Batch;
  import com.badlogic.gdx.scenes.scene2d.Actor;
  import com.badlogic.gdx.scenes.scene2d.InputEvent;
  import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener;
  
  public class Tess extends Actor {
  
      private Texture texture;
      private boolean selected = false;
  
      public Tess (String img) {
          this.texture = new Texture(Gdx.files.internal(img));
          this.setBounds(0f, 0f, this.texture.getWidth(), this.texture.getHeight());
          this.setOrigin(this.texture.getWidth() / 2, this.texture.getHeight() / 2);
          this.setScale(0.25f);
          this.addListener(new ActorGestureListener() {
              public void tap(InputEvent event, float x, float y, int pointer, int button) {
                  ((Tess)event.getTarget()).toggleSelect();
                  ((Tess)event.getTarget()).setColor(0.5f, 0f, 0.5f, 1f);
              }
          });
      }
  
      @Override
      public void draw(Batch batch, float alpha){
          batch.draw(texture, 0, 0);
      }
  
      public void finalize() {
          this.texture.dispose();
      }
  
      public void toggleSelect(){
          this.selected = !this.selected;
          if (this.selected == true)
              this.setColor(0.5f, 0f, 0.5f, 1f);
          else
              this.setColor(0f, 0f, 0f, 0f);          
      }
  }
  </code></pre>
  
  <p>The screen shows correctly the actor, but I cannot set the Actor's position or its scale, nor the "tap" event seems to get detected; and the color doesn't change.</p>
  
  <p>What I did wrong?</p>