예제 #1
0
  public RoleTile(Dir dir, Role role) {

    List<Bitmap> headIcons = LoadRes.getHeadIcons();

    Bitmap head = headIcons.get(role.getIconIndex());
    float width = 200;
    headIconTile = new BitmapOverlay(head);

    nameTile = new TextOverlay(width, 23);
    nameTile.setText(role.getName(), true);
    nameTile.setPos(0, -40);

    wealthTile = new TextOverlay(width, 23);
    currentScore = role.getWealth();
    wealthTile.setText("" + currentScore, true);
    wealthTile.setPos(0, -70);

    switch (dir) {
      case Left:
        setPos(210, 650);
        break;
      case Right:
        setPos(800, 650);
        break;
      case Outside:
        setPos(70, 50);
    }

    addChildren(headIconTile, nameTile, wealthTile);
  }
예제 #2
0
  public void update(Role role) {
    List<Bitmap> headIcons = LoadRes.getHeadIcons();
    Bitmap head = headIcons.get(role.getIconIndex());

    headIconTile.setBitmap(head);
    nameTile.setText(role.getName());
    currentScore = role.getWealth();
    wealthTile.setText("" + currentScore);
  }