Fix followers when window resize
This commit is contained in:
+1
-1
Submodule hyperlap2d-common-api updated: 769f77b06e...dfa6711ad7
@@ -160,6 +160,8 @@ public class HyperLap2DScreen implements Screen, InputProcessor {
|
||||
screenSize.set(width, height);
|
||||
|
||||
updateCameraPosition();
|
||||
|
||||
updateActorSize();
|
||||
}
|
||||
|
||||
public void updateActorSize() {
|
||||
@@ -191,7 +193,7 @@ public class HyperLap2DScreen implements Screen, InputProcessor {
|
||||
|
||||
if (!isDrawingBgLogo) {
|
||||
bgLogo.clearActions();
|
||||
bgLogo.addAction(Actions.sequence(Actions.alpha(0, .2f, Interpolation.smooth), Actions.removeActor()));
|
||||
bgLogo.addAction(Actions.sequence(Actions.alpha(0, .2f, Interpolation.smooth), Actions.scaleTo(uiStage.getUIScaleDensity(), uiStage.getUIScaleDensity()), Actions.removeActor()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -556,5 +556,7 @@ public class Sandbox {
|
||||
return;
|
||||
|
||||
sceneLoader.resize(width, height);
|
||||
if (getViewport() != null)
|
||||
getCamera().update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +137,7 @@ public class SandboxMediator extends Mediator<Sandbox> {
|
||||
case MsgAPI.RESIZE:
|
||||
int[] data = notification.getBody();
|
||||
viewComponent.resize(data[0], data[1]);
|
||||
facade.sendNotification(MsgAPI.UPDATE_ALL_FOLLOWERS);
|
||||
break;
|
||||
case MsgAPI.DISPOSE:
|
||||
viewComponent.dispose();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class FollowersUIMediator extends Mediator<FollowersUI> {
|
||||
@Override
|
||||
public String[] listNotificationInterests() {
|
||||
return new String[]{
|
||||
MsgAPI.RESIZE,
|
||||
MsgAPI.UPDATE_ALL_FOLLOWERS,
|
||||
MsgAPI.SCENE_LOADED,
|
||||
MsgAPI.ITEM_DATA_UPDATED,
|
||||
MsgAPI.ITEM_SELECTION_CHANGED,
|
||||
@@ -99,7 +99,7 @@ public class FollowersUIMediator extends Mediator<FollowersUI> {
|
||||
break;
|
||||
case PanTool.SCENE_PANNED:
|
||||
case MsgAPI.ZOOM_CHANGED:
|
||||
case MsgAPI.RESIZE:
|
||||
case MsgAPI.UPDATE_ALL_FOLLOWERS:
|
||||
updateAllFollowers();
|
||||
break;
|
||||
case MsgAPI.ITEM_SELECTION_CHANGED:
|
||||
|
||||
Reference in New Issue
Block a user