LoginSignup
0
0

More than 5 years have passed since last update.

Pixi.js で Stage の touchEvent から position を取得する

Last updated at Posted at 2016-09-01

悩んだのでメモ。

var stage = new PIXI.Stage(0x000000);
stage.interactive = true;
stage.on("touchstart", function(event) {
    var touch_0 = event.data.originalEvent.changedTouches[0];
    var x = touch_0.globalX;
    var y = touch_0.globalY;
});

touch_0 の中身はこんなのが入ってる。

  • globalX
  • globalY
  • identifier
  • target (object)
  • screenX
  • screenY
  • clientX
  • clientY
  • pageX
  • pageY
  • radiusX
  • radiusY
  • rotationAngle
  • force

target 以外はnumber型で入っている。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0