Android Open Source - AndroidShooter Table Actor






From Project

Back to project page AndroidShooter.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidShooter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package jonathan.geoffroy.shooter.view.utils;
/*from w  w w  .  ja  v  a2s  . c  o  m*/
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Table;

public abstract class TableActor extends Actor {
  protected Table table;

  public TableActor() {
    table = new Table();
  }


  @Override
  public void draw(SpriteBatch batch, float parentAlpha) {
    super.draw(batch, parentAlpha);
    table.draw(batch, parentAlpha);
  }


  /**
   * load table for the first time on the current screen
   */
  public abstract void loadTable();

  /**
   * compute the table again when there is a change on the current screen
   */
  public void reloadTable() {
    table.clear();
    loadTable();
  }

  public Table getTable() {
    return table;
  }

  public void setTable(Table table) {
    this.table = table;
  }

  @Override
  public void setVisible(boolean visible) {
    super.setVisible(visible);
    table.setVisible(visible);
  }


  @Override
  public void setBounds(float x, float y, float width, float height) {
    super.setBounds(x, y, width, height);
    table.setBounds(x, y, width, height);
  }
}




Java Source Code List

jonathan.geoffroy.shooter.MainActivity.java
jonathan.geoffroy.shooter.Main.java
jonathan.geoffroy.shooter.Shooter.java
jonathan.geoffroy.shooter.model.Bullet.java
jonathan.geoffroy.shooter.model.Map.java
jonathan.geoffroy.shooter.model.characters.Character.java
jonathan.geoffroy.shooter.model.characters.Coord2F.java
jonathan.geoffroy.shooter.view.actors.CharacterActor.java
jonathan.geoffroy.shooter.view.actors.JoystickActor.java
jonathan.geoffroy.shooter.view.actors.MapActor.java
jonathan.geoffroy.shooter.view.screens.GameScreen.java
jonathan.geoffroy.shooter.view.screens.LevelScreen.java
jonathan.geoffroy.shooter.view.screens.MainMenuScreen.java
jonathan.geoffroy.shooter.view.utils.App.java
jonathan.geoffroy.shooter.view.utils.HelpScreen.java
jonathan.geoffroy.shooter.view.utils.ListActor.java
jonathan.geoffroy.shooter.view.utils.StageScreen.java
jonathan.geoffroy.shooter.view.utils.TableActor.java
jonathan.geoffroy.shooter.view.utils.WallpaperActor.java