Android Open Source - androidtbsgame Model H U D






From Project

Back to project page androidtbsgame.

License

The source code is released under:

MIT License

If you think the Android project androidtbsgame 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 de.mmssb.androidtbsgame.andengine.hud;
/*w ww. java  2s.  c o  m*/
import org.andengine.engine.camera.hud.HUD;

import de.mmssb.androidtbsgame.andengine.Model;

/**
 * @author Manu
 * 
 */
public class ModelHUD extends HUD {
  private Model model;

  /**
   * Creates an instance of {@link ModelHUD}
   * 
   * @param model
   *            {@link Model} reference
   */
  public ModelHUD(Model model) {
    this.setModel(model);
    initialize();
  }

  /**
   * Initialize the {@link ModelHUD}
   */
  private void initialize() {
    // Adds two test-buttons to the HUD
    ImageButtonSprite buttonSettings = new ImageButtonSprite(0, 0, model
        .getMainActivity().getSmoothCamera().getWidth() * 0.2f, model
        .getMainActivity().getSmoothCamera().getHeight() * 0.2f, model
        .getResourceManager().getTiledTextureRegionButton(), model
        .getResourceManager().getTextureRegionButtonSettings(), this,
        model.getMainActivity().getVertexBufferObjectManager());
    attachChild(buttonSettings);
    ImageButtonSprite buttonMenu = new ImageButtonSprite(0,
        buttonSettings.getHeight(), model.getMainActivity()
            .getSmoothCamera().getWidth() * 0.2f,
        model.getMainActivity().getSmoothCamera().getHeight() * 0.2f,
        model.getResourceManager().getTiledTextureRegionButton(), model
            .getResourceManager().getTextureRegionButtonMenu(),
        this, model.getMainActivity().getVertexBufferObjectManager());
    attachChild(buttonMenu);
  }

  public Model getModel() {
    return model;
  }

  public void setModel(Model model) {
    this.model = model;
  }
}




Java Source Code List

de.mmssb.androidtbsgame.andengine.BoardMap.java
de.mmssb.androidtbsgame.andengine.GameControl.java
de.mmssb.androidtbsgame.andengine.MainActivity.java
de.mmssb.androidtbsgame.andengine.Model.java
de.mmssb.androidtbsgame.andengine.entities.board.Board.java
de.mmssb.androidtbsgame.andengine.entities.board.Cell.java
de.mmssb.androidtbsgame.andengine.entities.board.Mark.java
de.mmssb.androidtbsgame.andengine.hud.ImageButtonSprite.java
de.mmssb.androidtbsgame.andengine.hud.ModelHUD.java
de.mmssb.androidtbsgame.andengine.managers.CellControl.java
de.mmssb.androidtbsgame.andengine.managers.Manager.java
de.mmssb.androidtbsgame.andengine.managers.ResourceManager.java
de.mmssb.androidtbsgame.andengine.managers.SceneManager.java
de.mmssb.androidtbsgame.andengine.managers.SharedPreferencesManager.java
de.mmssb.androidtbsgame.andengine.scenes.GameScene.java
de.mmssb.androidtbsgame.andengine.scenes.ModelScene.java
de.mmssb.androidtbsgame.andengine.units.AnimationProperties.java