Update: CC - Touch Move (evwkow5289.js) 3 bytes modified

beta.r3js.org
-=yb4f310 2018-03-09 12:26:51 +01:00
parent 4dc2ef9aa5
commit 7603349221
1 changed files with 8 additions and 6 deletions

View File

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