doppler Posted June 23, 2016 Share Posted June 23, 2016 Does anybody know how to subtract the alpha values from a shape? After hours of research, my best bet is to utilize an alpha filter (link) The current Shape.mask value does not seem to have an easy way to invert masks (link) Example of what I want to achieve: Quote Link to comment Share on other sites More sharing options...
Anders Athletic Design Posted June 28, 2016 Share Posted June 28, 2016 I have not yet worked with the alpha filters but for a normal mask I don't think there is an easy way of doing it. I would probably have made the inverted mask in Flash IDE and then exported it with Toolkit For CreateJS. That is, the exported mask would be a big rectangle with a cut out circle in the middle. A 100x100 rect with a 33 diameter circle in the middle produces the following code: this.shape = new cjs.Shape(); this.shape.graphics.beginFill("rgba(255,255,255,0.761)").beginStroke().moveTo(-50,50).lineTo(-50,-50).lineTo(50,-50).lineTo(50,50).closePath() .moveTo(-12.2,-12.1).curveTo(-17,-7.3,-17,-0.5).curveTo(-17,6.4,-12.2,11.1).curveTo(-7.3,16,-0.5,16).curveTo(6.4,16,11.1,11.1).curveTo(16,6.4,16,-0.5).curveTo(16,-7.3,11.1,-12.1).curveTo(6.4,-17,-0.5,-17).curveTo(-7.3,-17,-12.2,-12.1).closePath(); 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.