fixed minor mistake in world layer

v5stable
ondra 11 years ago
parent 56aef90e83
commit 30857951e0
  1. 5
      src/mightypork/rogue/screens/ingame/WorldLayer.java
  2. 4
      src/mightypork/rogue/screens/ingame/WorldRenderer.java
  3. 9
      src/mightypork/rogue/screens/main_menu/MenuLayer.java
  4. 2
      src/mightypork/rogue/world/level/Level.java

@ -17,6 +17,7 @@ import mightypork.rogue.world.World;
import mightypork.rogue.world.entity.Entity;
import mightypork.rogue.world.entity.models.EntityMoveListener;
import mightypork.rogue.world.level.Level;
import mightypork.util.constraints.num.Num;
import mightypork.util.ion.Ion;
@ -50,8 +51,10 @@ public class WorldLayer extends ScreenLayer {
// return;
// }
final Num minWH = root.width().min(root.height()).max(700); // avoid too small shrinking
final WorldRenderer wr = new WorldRenderer(w);
wr.setRect(root);
wr.setRect(root.shrinkBottom(minWH.perc(7)));
root.add(wr);
final PlayerControl c = w.getPlayerControl();

@ -34,7 +34,7 @@ public class WorldRenderer extends InputComponent implements Updateable {
leftShadow = leftEdge().growRight(grX);
rightShadow = rightEdge().growLeft(grX);
topShadow = topEdge().growDown(grY);
bottomShadow = bottomEdge().growUp(grY).moveY(minWH.perc(-6));
bottomShadow = bottomEdge().growUp(grY); //.moveY(minWH.perc(-6))
}
@ -48,7 +48,7 @@ public class WorldRenderer extends InputComponent implements Updateable {
@Override
protected void renderComponent()
{
world.render(this, 8, 6, 110);
world.render(this, 8, 7, 100);
Render.quadGradH(leftShadow, RGB.BLACK, RGB.NONE);
Render.quadGradH(rightShadow, RGB.NONE, RGB.BLACK);

@ -12,6 +12,7 @@ import mightypork.rogue.screens.CrossfadeRequest;
import mightypork.util.constraints.num.Num;
import mightypork.util.constraints.rect.Rect;
import mightypork.util.control.Action;
import mightypork.util.math.color.COMMODORE;
import mightypork.util.math.color.PAL16;
@ -40,16 +41,16 @@ class MenuLayer extends ScreenLayer {
TextPainter tp;
MenuButton b0, b1, b2, b3, b4;
tp = new TextPainter(Res.getFont("main_menu_title"), AlignX.CENTER, PAL16.ZORNSKIN, "Rogue!");
b0 = new MenuButton("Ingame", PAL16.SLIMEGREEN);
tp = new TextPainter(Res.getFont("main_menu_title"), AlignX.CENTER, COMMODORE.PURPLE, "Rogue!");
b0 = new MenuButton("World Test", PAL16.SLIMEGREEN);
b1 = new MenuButton("Gradientz", PAL16.BLAZE);
b2 = new MenuButton("Bouncy Cubes", PAL16.NEWPOOP);
b2 = new MenuButton("Bouncy Cubes", PAL16.CLOUDBLUE);
b3 = new MenuButton("Flying Cat", PAL16.PIGMEAT);
b4 = new MenuButton("Bye!", PAL16.BLOODRED);
int r = 0;
layout.put(tp, r, 0, 4, 1);
layout.put(tp, r, 0, 3, 1);
r += 5;
layout.put(b0, r, 0, 2, 1);
r += 3;

@ -254,7 +254,7 @@ public class Level implements MapAccess, IonBinary {
//tileSize -= tileSize % 8;
final VectConst vpCenter = r.center().sub(tileSize * 0.5, tileSize).freeze(); // 0.5 to center, 1 to move up (down is teh navbar)
final VectConst vpCenter = r.center().sub(tileSize * 0.5, tileSize * 0.5).freeze(); // 0.5 to center, 1 to move up (down is teh navbar)
final double playerX = pos.getVisualX();
final double playerY = pos.getVisualY();

Loading…
Cancel
Save