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