Big Bad Waffle 4 anni fa
parent
commit
e971964eef
2 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. +2
    -2
      src/client/js/components/spellbook.js
  2. +6
    -2
      src/client/js/input.js

+ 2
- 2
src/client/js/components/spellbook.js Vedi File

@@ -90,8 +90,8 @@ define([
onMouseDown: function (e, target) {
if (isMobile && this.groundTargetSpell) {
this.groundTarget = {
x: ~~(e.x / scale),
y: ~~(e.y / scale)
x: ~~(e.worldX / scale),
y: ~~(e.worldY / scale)
};

this.onKeyDown(this.groundTargetSpell);


+ 6
- 2
src/client/js/input.js Vedi File

@@ -197,6 +197,10 @@ define([
this.mouse.down = true;
this.mouse.event = e;

//This is needed for casting targetted spells on Mobile...it's hacky.
this.mouse.worldX = e.pageX + renderer.pos.x;
this.mouse.worldY = e.pageY + renderer.pos.y;

events.emit('mouseDown', this.mouse);
},
mouseUp: function (e) {
@@ -223,8 +227,8 @@ define([
return;

const zoom = window.devicePixelRatio;
this.mouse.x = e.offsetX * zoom + renderer.pos.x;
this.mouse.y = e.offsetY * zoom + renderer.pos.y;
this.mouse.x = (e.offsetX * zoom) + renderer.pos.x;
this.mouse.y = (e.offsetY * zoom) + renderer.pos.y;
}
},



Caricamento…
Annulla
Salva