You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 9, 2019. It is now read-only.
If you position a hidden circle over a visible circle the event on the visible circle will not get triggered.
var radius = 20;
var display = doodle.createDisplay('#display', {width:600, height:600});
var layer0 = display.createLayer();
// target circle
var sprite = doodle.createSprite();
sprite.graphics.lineStyle(0, 0x000000, 0);
sprite.graphics.beginFill(0x22ff55);
sprite.graphics.circle(0, 0, radius);
sprite.graphics.endFill();
sprite.x = 200;
sprite.y = 200;
layer0.addChild(sprite);
// flash circle
var circleFlash = doodle.createSprite();
circleFlash.graphics.lineStyle(0, 0x000000, 0);
circleFlash.graphics.beginFill(0xffffff);
circleFlash.graphics.circle(0, 0, radius * 2);
circleFlash.graphics.endFill();
circleFlash.x = sprite.x;
circleFlash.y = sprite.y;
circleFlash.visible = false;
layer0.addChild(circleFlash);
// sprite click event
sprite.on(doodle.events.MouseEvent.CLICK, function (event) {
console.info( 'click'); // will not execute if flash circle is hidden over top of the sprite circle
});