Avatar Posted July 12, 2015 Share Posted July 12, 2015 Pixi doesn't seem to call mousedown and mouseup when i click on an empty part of a container in the example below. Am i doing anything wrong or is this a bug in Pixi? I'm using version 3.0.7.<html><head><script src="libs/pixi.js"></script></head><body><script type="text/javascript">var renderer = PIXI.autoDetectRenderer(1000, 1000, { antialias: true, backgroundColor: 0x2F2312 });document.body.appendChild(renderer.view);// create the root of the scene graphvar stage = new PIXI.Container();stage.interactive = true;var graphics = new PIXI.Graphics();graphics.lineStyle(1, 0xFF00FF, 1);graphics.beginFill(0xFFFF0B, 0.5);graphics.drawCircle(140, 120,100);graphics.endFill();stage.addChild(graphics);stage.mousedown = function (moveData) { console.log("mousedown");};stage.mousemove = function (moveData) { console.log("mousemove");};stage.mouseup = function (moveDate) { console.log("mouseup");};// run the render loopanimate();function animate() { renderer.render(stage); requestAnimationFrame( animate );}</script></body></html> Quote Link to comment Share on other sites More sharing options...
xerver Posted July 12, 2015 Share Posted July 12, 2015 https://github.com/GoodBoyDigital/pixi.js/issues/1825 Not yet implemented in v3 Quote Link to comment Share on other sites More sharing options...
Lsmjudoka Posted July 13, 2015 Share Posted July 13, 2015 Had the same issue, try adding this:stage.hitArea = new PIXI.Rectangle(0, 0, 1000, 1000); Quote Link to comment Share on other sites More sharing options...
Avatar Posted July 18, 2015 Author Share Posted July 18, 2015 Thanx for answering. I'll try the stage.hitArea for now. Quote Link to comment Share on other sites More sharing options...
agmcleod Posted November 3, 2015 Share Posted November 3, 2015 Worked for me, thanks @Lsmjudoka Quote Link to comment Share on other sites More sharing options...
caymanbruce Posted December 18, 2016 Share Posted December 18, 2016 On 7/13/2015 at 2:19 PM, Lsmjudoka said: Had the same issue, try adding this: stage.hitArea = new PIXI.Rectangle(0, 0, 1000, 1000); Thanks it still works in v4.2.3. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.