Jump to content

Why `containsPoint` not working?(can not fill with bezierCurveTo)


fancyoung
 Share

Recommended Posts

These two steps fix the second shape, which now gets filled and works with containsPoint

1. Change graphics.beginFill and graphics.endFill to graphics2.beginFill and graphics2.endFill

2. Move graphics2.beginFill to before graphics2.moveTo

var graphics2 = new PIXI.Graphics();
graphics2.lineStyle(1, 0xFFFFFF, 1);
graphics2.beginFill(0x999999, 1);
graphics2.moveTo(120, 10);
graphics2.bezierCurveTo(130, 0, 130, 0, 200, 10);
graphics2.bezierCurveTo(250, 100, 250, 100, 120, 200);
graphics2.bezierCurveTo(130, 0, 130, 0, 120, 10);
//graphics2.currentPath.shape.closed = true;
graphics2.endFill();
viewerStage.addChild(graphics2);

 

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