diff --git a/evwkow5289.js b/evwkow5289.js index a72560d..cddcbe2 100644 --- a/evwkow5289.js +++ b/evwkow5289.js @@ -7,8 +7,10 @@ if (!this.initialized) { this.dom = this.entityLoaded.dom; - this.x = window.innerWidth / 2; - this.y = window.innerHeight / 2; + var size = GameLib.Utils.GetWindowSize(); + + this.x = size.width / 2; + this.y = size.height / 2; this.initialized = true; } @@ -43,16 +45,16 @@ if (this.x < 0) { this.x = 0; } -if (this.x > window.innerWidth) { - this.x = window.innerWidth; +if (this.x > size.width) { + this.x = size.width; } if (this.y < 0) { this.y = 0; } -if (this.y > window.innerHeight) { - this.y = window.innerHeight; +if (this.y > size.height) { + this.y = size.height; } GameLib.Event.Emit(