Refactoring and documentation update
This commit is contained in:
parent
5b6a8ca4d7
commit
f761858328
7 changed files with 47 additions and 23 deletions
|
@ -90,7 +90,7 @@ import { contactPageStore } from "../../Stores/MenuStore";
|
|||
import { GameMapProperties } from "./GameMapProperties";
|
||||
import SpriteSheetFile = Phaser.Loader.FileTypes.SpriteSheetFile;
|
||||
import Camera = Phaser.Cameras.Scene2D.Camera;
|
||||
import type { HasCameraMovedEvent } from "../../Api/Events/HasCameraMovedEvent";
|
||||
import type { WasCameraUpdatedEvent } from "../../Api/Events/WasCameraUpdatedEvent";
|
||||
|
||||
export interface GameSceneInitInterface {
|
||||
initPosition: PointInterface | null;
|
||||
|
@ -754,13 +754,13 @@ export class GameScene extends DirtyScene {
|
|||
|
||||
//listen event to share the actual worldView when the camera is updated
|
||||
this.cameras.main.on("followupdate", (camera: Camera) => {
|
||||
const worldView: HasCameraMovedEvent = {
|
||||
const worldView: WasCameraUpdatedEvent = {
|
||||
x: camera.worldView.x,
|
||||
y: camera.worldView.y,
|
||||
width: camera.worldView.width,
|
||||
height: camera.worldView.height,
|
||||
};
|
||||
iframeListener.hasCameraMoved(worldView);
|
||||
iframeListener.sendCameraUpdated(worldView);
|
||||
});
|
||||
|
||||
// Set up variables manager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue