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

beta.r3js.org
-=yb4f310 2018-03-09 12:29:11 +01:00
parent 7603349221
commit f7e03b74c4
1 changed files with 14 additions and 5 deletions

View File

@ -7,7 +7,16 @@ if (!this.initialized) {
this.dom = this.entityLoaded.dom;
var size = GameLib.Utils.GetWindowSize();
GameLib.Event.Subscribe(
GameLib.Event.WINDOW_RESIZE,
function(data) {
this.size = data;
this.x = size.width / 2;
this.y = size.height / 2;
}.bind(this)
)
this.size = GameLib.Utils.GetWindowSize();
this.x = size.width / 2;
this.y = size.height / 2;
@ -45,16 +54,16 @@ if (this.x < 0) {
this.x = 0;
}
if (this.x > size.width) {
this.x = size.width;
if (this.x > this.size.width) {
this.x = this.size.width;
}
if (this.y < 0) {
this.y = 0;
}
if (this.y > size.height) {
this.y = size.height;
if (this.y > this.size.height) {
this.y = this.size.height;
}
GameLib.Event.Emit(