Jump to content

How to refer to the window/screen of device in PIXI


Freckles
 Share

Recommended Posts

I have this line "window.addEventListener('click', overBack);" which works perfectly. When having "window.on('click', overBack)" window is undefined, so I left the first option. But the problem is that "window.addEventListener('tap', overBack);" doesn't do the job. I've tried to replace window with page and screen and it didn't work. So I thought you might help me. How do I refer to the window/screen?

Thanks in advance

Link to comment
Share on other sites

@jonforum I tried `document.addEventListener('tap', overBack)` and it didn't work for mobile though with 'click' event it works for web. 

edit: the problem was that I used event.pageX in overBack function which is undefined on mobile. I changed it to event.touches[0].pageX and it worked. I should've checked that earlier)

 

Edited by Freckles
Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...