Re: More CALayer Questions
Re: More CALayer Questions
- Subject: Re: More CALayer Questions
- From: Bill Dudney <email@hidden>
- Date: Mon, 07 Jul 2008 17:07:39 -0600
Hi Gordon,
'the upcomming book on animation'?
If by that you mean the Core Animation book from Pragmatic Programmers
you can get the PDF now from
http://www.pragprog.com/titles/bdcora
and then the paper when it ships. You get a really good discount on it
if you buy both.
Not sure where the July 17 date comes from (amazon.com?) but its
likely off by at least 2 weeks and probably a bit more like 4.
Now on to the real question... Basically what you are doing is
confusing the tar out of the layer living in your view by messing with
any of its properties.
If you do something like this;
myView.wantsLayer = YES;
And then do something like this;
myView.layer.position = myPoint;
you are asking for trouble.
You should instead do something like this;
myView.layer = [CALayer layer];
myView.wantsLayer = YES:
layerToMove = [CALayer layer];
[myView.layer addSublayer:layerToMove]
then you can
layerToMove.position = somePoint;
To your hearts desire and everything should be lovely :)
Then if you want to do 'struts and springs' type stuff with
layerToMove you can use a layoutManager to do all sorts of cool and
exciting stuff.
Good luck!
-bd-
http://bill.dudney.net/roller/objc
On Jul 7, 2008, at 4:05 PM, Gordon Apple wrote:
OK, a little update. Through watching a number of parameters, a
lot of
experimentation, and probably blind a** luck, I've managed to get
rescaling
to sort of work. However, to do editing of objects (e.g., dragging
them
around), I had to call "removeAllAnimations". When I change the
scale, the
scale does change, but the layer does not change to the correct
position
until I resize the window -- then it snaps into correct position.
Resizing
the window results in the drawing disappearing and reappearing, mostly
reappearing when downsizing. It also disappears when scrolled,
until the
window is resized. I assume this has something to do with re-caching
the
layer. How do I fix that?
I need to get this working right before I go back to stacking
layers.
BTW, I've preordered (July 17) the upcoming book on animation,
but I
have no idea whether or not it will have anything useful for these
CALayer
issues.
I'm suffering from extreme frustration with CALayers. I obviously
don't
understand the documentation available and there is a lot that is not
documented, especially since the Views guide has not been updated
to include
CALayers. Also, as others have observed, the "flipped" paremeter in
[NSGraphicsContext graphicsContextWithGraphicsPort:ctx flipped:YES]
simply
does not work.
.......
_______________________________________________
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
_______________________________________________
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