コード例 #1
0
  public AbstractBuildingView(
      final AbstractScreen screen, MapGrid map, AbstractBuildingItem building) {
    mBuilding = building;
    mMap = map;
    mScreen = screen;

    mBuildingTexture = loadBuildingTexture();

    map.setChildPosition(this, building.getX(), building.getY());
    map.addActor(this);
  }
コード例 #2
0
 public void drawBuilding(Batch batch) {
   float csx = mMap.getCellSideX();
   float csy = mMap.getCellSideY();
   batch.draw(mBuildingTexture, 0, 0, csx * mBuilding.getSize().x, csy * mBuilding.getSize().y);
 }
コード例 #3
0
 @Override
 public void act(float delta) {
   mMap.setChildPosition(this, mBuilding.getX(), mBuilding.getY());
 }