recode game window, improve mouse lock handling, improve debug overlay, version 1.1.2
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
export default class ScreenRenderer {
|
||||
|
||||
static UPSCALE = 3;
|
||||
|
||||
constructor(minecraft, window) {
|
||||
this.minecraft = minecraft;
|
||||
this.window = window;
|
||||
|
||||
this.upscale = window.isMobileDevice() ? 1 : 3;
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.resolution = this.minecraft.isInGame() ? 1 : this.minecraft.window.scaleFactor; // Increase resolution for the splash text
|
||||
|
||||
// Update camera size
|
||||
this.window.canvas2d.width = this.window.width * ScreenRenderer.UPSCALE;
|
||||
this.window.canvas2d.height = this.window.height * ScreenRenderer.UPSCALE;
|
||||
this.window.canvas2d.width = this.window.width * this.upscale;
|
||||
this.window.canvas2d.height = this.window.height * this.upscale;
|
||||
|
||||
// Get context stack of 2d canvas
|
||||
this.stack2d = this.window.canvas2d.getContext('2d');
|
||||
@@ -26,7 +26,7 @@ export default class ScreenRenderer {
|
||||
let mouseY = this.minecraft.window.mouseY;
|
||||
|
||||
this.stack2d.save();
|
||||
this.stack2d.scale(ScreenRenderer.UPSCALE, ScreenRenderer.UPSCALE, ScreenRenderer.UPSCALE);
|
||||
this.stack2d.scale(this.upscale, this.upscale, this.upscale);
|
||||
|
||||
// Reset 2d canvas
|
||||
this.stack2d.clearRect(0, 0, this.window.width, this.window.height);
|
||||
|
||||
Reference in New Issue
Block a user