开发者

Created a layer mask on touch in Objective-c

开发者 https://www.devze.com 2023-02-16 07:21 出处:网络
I need to figure out the following: Have two layers stacked (Most likely static png\'s) then in swipe create a feathered layer mask on the top most layer.

I need to figure out the following:

  • Have two layers stacked (Most likely static png's) then in swipe create a feathered layer mask on the top most layer.
  • Give the bottom most layer a centered pivot point and have it capable of a full 360 degree rotation. The angle of that bottom most layer will be determined by th开发者_开发问答e angle of the users swipe motion.

This is for a project I'm currently working on and it's these two things that are stumping me. As always, any help is appreciated. Thanks!


Are you referring to layers as CALayer? Is there any reason you don't just use UIViews?

Anyway, layer masks can be easily created on a view:

CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = frame;
maskLayer.path = maskPath.CGPath;
controller.view.layer.mask = maskLayer;
0

精彩评论

暂无评论...
验证码 换一张
取 消