예제 #1
0
 public void render(SpriteBatch batch) {
   int itemsAmount = items.entrySet().size();
   Camera2d c = batch.getCamera();
   for (Entry<ItemType, Integer> e : items.entrySet()) {
     ModelTexture tex = e.getKey().getTexture();
     int i = itemsAmount--;
     batch.draw(
         tex,
         c.getWidth() / 2 - 50 - (i * 100),
         -c.getHeight() / 2 + 50,
         100,
         100,
         tex.getUVs(),
         0,
         0,
         0);
     font.drawString(
         batch,
         Integer.toString(e.getValue()),
         (int) (font.getOriginalSize() * 0.7),
         c.getWidth() / 2 - 50 - (i * 100),
         -c.getHeight() / 2 + 50);
   }
 }
예제 #2
0
 @Override
 public void render(SpriteBatch batch) {
   batch.draw(texture, x - size / 2, y - size / 2, size, size);
 }