Need functionality of CAShapeLayer in 10.5
Need functionality of CAShapeLayer in 10.5
- Subject: Need functionality of CAShapeLayer in 10.5
- From: Kenneth Baxter <email@hidden>
- Date: Wed, 22 Sep 2010 00:02:35 +0000 (GMT)
Hi all, I had gone through my initial design for a project I am working on and one part of it really needs to use CAShapeLayer, but I just realized that it's only available in 10.6+, and I have to support 10.5.
Essentially I have two layers that have a bezier path drawn between them. The two layers at each end of the path are moved during animations, and the bezier path needs to be adjusted to stay connected with the layers at each end Seems to me that this would be easily done by CAShapeLayer, if I could use it.
I presume people were probably doing this type of thing before CAShapeLayer came along, so I'm wondering if there is some sample code for an equivalent of CAShapeLayer or at least something that will allow me to easily update the path during the animation.
I was thinking of using a startPoint and endPoint for the path which are animated, and have setNeedsDisplayForKey set, and just recalculate the path in the drawing method
Is this a good approach, or is there a better way, or some existing code that may help out with this?
It would be nice to be able to do something that has an API match with CAShapeLayer, so that when I can ditch 10.5 support (hopefully soon), I could just move straight to CAShapeLayer without having to change anything else, but that would presumably mean animating an arbitrary number of points in the bezier path and handling all sorts of situations like one path having more points than the other etc.
Any suggestions would be most welcome.
Thanks
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden