some more tweaks with smooth zooming control
This commit is contained in:
parent
092daa245f
commit
ddaa81a7ac
3 changed files with 54 additions and 18 deletions
|
@ -12,8 +12,6 @@ export class WaScaleManager {
|
|||
private actualZoom: number = 1;
|
||||
private _saveZoom: number = 1;
|
||||
|
||||
private zoomingViaPlayerInputLocked: boolean = false;
|
||||
|
||||
public constructor(private minGamePixelsNumber: number, private absoluteMinPixelNumber: number) {
|
||||
this.hdpiManager = new HdpiManager(minGamePixelsNumber, absoluteMinPixelNumber);
|
||||
}
|
||||
|
@ -23,14 +21,6 @@ export class WaScaleManager {
|
|||
this.game = game;
|
||||
}
|
||||
|
||||
public isZoomingViaPlayerInputLocked(): boolean {
|
||||
return this.zoomingViaPlayerInputLocked;
|
||||
}
|
||||
|
||||
public lockZoomingViaPlayerInput(lock: boolean = true): void {
|
||||
this.zoomingViaPlayerInputLocked = lock;
|
||||
}
|
||||
|
||||
public applyNewSize() {
|
||||
const { width, height } = coWebsiteManager.getGameSize();
|
||||
|
||||
|
@ -82,6 +72,10 @@ export class WaScaleManager {
|
|||
this._saveZoom = this.hdpiManager.zoomModifier;
|
||||
}
|
||||
|
||||
public getSaveZoom(): number {
|
||||
return this._saveZoom;
|
||||
}
|
||||
|
||||
public restoreZoom(): void {
|
||||
this.hdpiManager.zoomModifier = this._saveZoom;
|
||||
this.applyNewSize();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue