Fixed entities not un-setting selection on mobile

Fixed entities not un-setting selection on mobile
Fixed projection matrix not setting to the correct viewport
Changed auto zoom to apply if default viewport is 360p (for desktop debugging)
This commit is contained in:
Collin Smith 2019-03-11 04:00:31 -07:00
parent 70fc628fba
commit 6b5ab8224e

View File

@ -444,6 +444,8 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
if (entity.isSelectable() && entity.position().dst(player.position()) <= entity.getInteractRange() * 2) {
entity.setOver(true);
addLabel(entity.getLabel());
} else {
entity.setOver(false);
}
}
} else {
@ -489,19 +491,12 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
mapRenderer.drawDebugPath(Riiablo.shapes, player.path());
Riiablo.shapes.end();
b.setProjectionMatrix(Riiablo.viewport.getCamera().combined);
b.setProjectionMatrix(viewport.getCamera().combined);
details = null;
stage.act();
stage.draw();
/*b.begin();
for (Entity entity : labels) {
entity.drawLabel(b);
System.out.println("label!");
}
b.end();*/
if (menu == null && !labels.isEmpty()) {
layoutLabels();
b.begin();
@ -526,7 +521,8 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable
mapRenderer.setMap(map);
mapRenderer.setSrc(player);
mapRenderer.setEntities(entities);
if (Gdx.app.getType() == Application.ApplicationType.Android) {
if (Gdx.app.getType() == Application.ApplicationType.Android
|| Riiablo.defaultViewport.getWorldHeight() == Riiablo.MOBILE_VIEWPORT_HEIGHT) {
mapRenderer.zoom(0.80f);
}
mapRenderer.resize();