Jump to content

PIXIJS: pointerover event does not trigger after first page load


DevMachine
 Share

Recommended Posts

Hi Dev community,

I have noticed that when I load up my PIXI game, the pointerover event doens't trigger after the first page load.
When it doesn't trigger for one button, it also doesn't work for other buttons.

This is usually fixed by refreshing the page, and once refreshed, if it works, it seems like it will keep working.
I have also noticed that after I right click and hit Inspect, the content starts being responsive, and works as expected.

Button clicks and the drag function below are triggered fine on the same buttons.

I have this sort of setup for my buttons:

this.sprite
    .on('pointerover', () => this.hover())
    .on('pointerout', () => this.hoverOff())
    // click
    .on('mousedown', () => this.mouseDown())
    .on('touchstart', () => this.mouseDown())
    // events for drag end
    .on('mouseup', () => this.mouseUp())
    .on('mouseupoutside', () => this.mouseUp())
    .on('touchend', () => this.mouseUp())
    .on('touchendoutside', () => this.mouseUp())
    // events for drag move
    .on('mousemove', (event) => this.drag(event))
    .on('touchmove', (event) => this.drag(event))

At first I assumed that it was related to assets not being loaded well, but now I am also using an asset loader and only starting to render after the necessary textures have been loaded.

 

I appreciate any help. Let me know what further info you may need.

I noticed that many people had issues with pointerovers on mobile, but I am on desktop Chrome, so I thought it's also not related to that.

 

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...