Jump to content

Pixijs doesn't recognize all pointer events


Recommended Posts

Hello,

I am currently trying out pixi but can't handle all pointer events. If I use pointermove it works like expected, but every other event from the InteractionManager does not work. I tried it with different devices.

 

That is my code which I am using:

<!DOCTYPE html>
<html>
  <body>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/5.1.3/pixi.min.js"></script>
    <script>
      var app = new PIXI.Application(window.innerWidth, window.innerHeight);
      document.body.appendChild(app.view);
      app.start();
      app.stage.interactive = true;
      app.stage.on("pointerdown", (event) => {
        var sprite = PIXI.Sprite.from(
          "https://s3-us-west-2.amazonaws.com/s.cdpn.io/693612/IaUrttj.png"
        );
        sprite.x = event.data.global.x;
        sprite.y = event.data.global.y;
        app.ticker.add((delta) => (sprite.rotation -= 0.01 * delta));
        app.stage.addChild(sprite);
      });
    </script>
  </body>
</html>

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...