Pixi.js: No pointeroverfired after pointerover when draw line

Created on 6 Apr 2020  ยท  5Comments  ยท  Source: pixijs/pixi.js

    const app = new Application({
        transparent:true,
        backgroundColor:'0xffffff',
        autoDensity:true,
        antialias:true,
        resolution:2,
        height:height,
        width:700,
        view:document.querySelect('#pixi')
    })
    app.renderer.plugins.interaction.moveWhenInside = true
    const line = new Graphics()
    line.lineStyle(1,0x26a69a,1)
    line.moveTo(40,0)
    line.lineTo(40,this._height)
    line.interactive = true
    line.on("pointerover", function(e) {
        console.log("pointerover over line");
    })
    app.stage.addChild(line)

Pixi.js 5.2.1
Browser :Chrome 80.0.3987.149

Stale ๐Ÿ‘ Not A Bug

Most helpful comment

@ivanpopelyshev Is there a fundamental reason why a line isn't clickable / hoverable? I could take a stab at it if there isn't.

All 5 comments

Interaction doesn't work with lines. If you want better interaction - override Graphics method containsPoint

I want highlight the line fired after pointerover. - override Graphics method containsPoint not work for me. Is there any other way?

@ivanpopelyshev Is there a fundamental reason why a line isn't clickable / hoverable? I could take a stab at it if there isn't.

How to monitor the click event of the line๏ผŸ

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings