Update: CC - Touch Move (evwkow5289.js) 195 bytes modified
parent
7603349221
commit
f7e03b74c4
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue