DEADSOFTWARE

Better creative inventory scrolling
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / GameRenderer.java
index 3ba99c3ec2c999dc7faa9866e3cb3bc5cc1d4430..38680f94db6ddf347491736c18872f5c80e544b1 100644 (file)
@@ -122,11 +122,11 @@ public class GameRenderer extends Renderer {
         spriteBatch.draw(Assets.creativeInv, x, y);
         spriteBatch.draw(Assets.creativeScroll, x+156,
                 y+18+(gameProc.creativeScroll*(72/gameProc.maxCreativeScroll)));
-        for (int i=gameProc.creativeScroll*40; i<(gameProc.creativeScroll+1)*40; i++) {
+        for (int i=gameProc.creativeScroll*8; i<(gameProc.creativeScroll+1)*40; i++) {
             if (i>0 && i<Items.BLOCKS.size)
                 spriteBatch.draw(Assets.blockTextures[Items.BLOCKS.getValueAt(i).getTexture()],
-                        x+8+((i-gameProc.creativeScroll*40)%8)*18,
-                        y+18+((i-gameProc.creativeScroll*40)/8)*18);
+                        x+8+((i-gameProc.creativeScroll*8)%8)*18,
+                        y+18+((i-gameProc.creativeScroll*8)/8)*18);
         }
         for (int i=0; i<9; i++) {
             if (gameProc.player.inventory[i]>0)