CPObjectCALayer
@implementation CALayer : CPObject
A CALayer
is similar to a CPView
, but with the ability
to have a transform applied to it.
Method Summary | |
---|---|
+(CALayer) | layer Returns a new animation layer. |
-(id) | init Initializes the animation layer. |
-(void) | addSublayer:(CALayer)aLayer Adds the specified layer as a sublayer of the receiver. |
-(CGAffineTransform) | affineTransform Returns the layer's affine transform. |
-(CGPoint) | anchorPoint Returns the layer's anchor point. |
-(CPColor) | backgroundColor Returns the layer's background color. |
-(CGRect) | backingStoreFrame The Backing Store Frame specifies the frame of the actual backing store used to contain this layer. |
-(CGRect) | bounds Returns the layer's bound. |
-(BOOL) | containsPoint:(CGPoint)aPoint Returns YES if the layer contains the point. |
-(CGImage) | contents Returns the CGImage contents of this layer. |
-(CGPoint) | convertPoint:(CGPoint)aPoint fromLayer:(CALayer)aLayer Converts the point from the specified layer's coordinate system into the receiver's coordinate system. |
-(CGPoint) | convertPoint:(CGPoint)aPoint toLayer:(CALayer)aLayer Converts the point from the receiver's coordinate system to the specified layer's coordinate system. |
-(CGRect) | convertRect:(CGRect)aRect fromLayer:(CALayer)aLayer Converts the rectangle from the specified layer's coordinate system to the receiver's coordinate system. |
-(CGRect) | convertRect:(CGRect)aRect toLayer:(CALayer)aLayer Converts the rectangle from the receier's coordinate system to the specified layer's coordinate system. |
-(id) | delegate Returns the layer's delegate. |
-(void) | display Displays the contents of this layer. |
-(void) | drawInContext:(CGContext)aContext Draws this layer's contents into the specified context. |
-(CGRect) | frame Returns the layer's frame. |
-(BOOL) | hidden Returns YES if the layer is hidden. |
-(CALayer) | hitTest:(CGPoint)aPoint Returns the farthest descendant of this layer that contains the specified point. |
-(void) | insertSublayer:(CALayer)aLayer above:(CALayer)aSublayer Inserts a layer above another layer. |
-(void) | insertSublayer:(CALayer)aLayer atIndex:(unsigned)anIndex Inserts the specified layer as a sublayer into the specified index. |
-(void) | insertSublayer:(CALayer)aLayer below:(CALayer)aSublayer Inserts a layer below another layer. |
-(BOOL) | isHidden Returns YES if the layer is hidden. |
-(BOOL) | needsDisplayOnBoundsChange Returns YES if the display should be redrawn on a bounds change. |
-(float) | opacity Returns the opacity of the layer. |
-(CGPoint) | position Returns the layer's position. |
-(void) | removeFromSuperlayer Removes the receiver from its superlayer. |
-(void) | replaceSublayer:(CALayer)aSublayer with:(CALayer)aLayer Replaces a sublayer. |
-(void) | setAffineTransform:(CGAffineTransform)anAffineTransform Sets the affine transform applied to this layer. |
-(void) | setAnchorPoint:(CGPoint)anAnchorPoint Sets the layer's anchor point. |
-(void) | setBackgroundColor:(CPColor)aColor Sets the layer's background color. |
-(void) | setBackingStoreFrame:(CGRect)aFrame Sets the frame's backing store. |
-(void) | setBounds:(CGRect)aBounds Sets the bounds (origin and size) of the rectangle. |
-(void) | setContents:(CGImage)contents Sets the image contents of this layer. |
-(void) | setDelegate:(id)aDelegate Sets the delegate for this layer. |
-(void) | setFrame:(CGRect)aFrame Sets the frame of the layer. |
-(void) | setHidden:(BOOL)isHidden Sets whether the layer is hidden. |
-(void) | setMasksToBounds:(BOOL)masksToBounds Sets whether content that goes lies outside the bounds is hidden or visible. |
-(void) | setNeedsDisplay Marks the layer as needing to be redrawn. |
-(void) | setNeedsDisplayInRect:(CGRect)aRect Marks the specified rectange as needing to be redrawn. |
-(void) | setNeedsDisplayOnBoundsChange:(BOOL)needsDisplayOnBoundsChange Sets whether the layer needs to be redrawn when its bounds are changed. |
-(void) | setOpacity:(float)anOpacity Sets the opacity for the layer. |
-(void) | setPosition:(CGPoint)aPosition Sets the layer's position. |
-(void) | setSublayerTransform:(CGAffineTransform)anAffineTransform Sets the affine transform that gets applied to all the sublayers. |
-(void) | setZPosition:(int)aZPosition Sets the layer's z-ordering. |
-(CGAffineTransform) | sublayerTransform Returns the affine transform applied to the sublayers. |
-(CPArray) | sublayers Returns an array of the receiver's sublayers. |
-(CALayer) | superlayer Returns the receiver's superlayer. |
Delegate Method Summary | |
---|---|
-(void) | drawLayer:(CALayer)layer inContext:(CGContextRef)ctx If the delegate implements this method, the CALayer will
call this in place of its drawInContext: . |
-(void) | displayLayer:(CALayer)layer The delegate can override the layer's display method
by implementing this method. |
Method Detail |
---|
+(CALayer)layer
-(id)init
-(void)addSublayer:(CALayer)aLayer
aLayer
-(CGAffineTransform)affineTransform
-(CGPoint)anchorPoint
-(CPColor)backgroundColor
-(CGRect)backingStoreFrame
-(CGRect)bounds
-(BOOL)containsPoint:(CGPoint)aPoint
YES
if the layer contains the point.aPoint
- the point to test-(CGImage)contents
CGImage
contents of this layer.
The default contents are nil
.-(CGPoint)convertPoint:(CGPoint)aPoint fromLayer:(CALayer)aLayer
aPoint
- the point to convertaLayer
- the layer coordinate system to convert from-(CGPoint)convertPoint:(CGPoint)aPoint toLayer:(CALayer)aLayer
aPoint
- the point to convertaLayer
- the layer coordinate system to convert to-(CGRect)convertRect:(CGRect)aRect fromLayer:(CALayer)aLayer
aRect
- the rectangle to convertaLayer
- the layer coordinate system to convert from-(CGRect)convertRect:(CGRect)aRect toLayer:(CALayer)aLayer
aRect
- the rectange to convertaLayer
- the layer coordinate system to convert to-(id)delegate
-(void)display
-(void)drawInContext:(CGContext)aContext
aContext
- the context to draw the layer into-(CGRect)frame
-(BOOL)hidden
YES
if the layer is hidden.-(CALayer)hitTest:(CGPoint)aPoint
aPoint
- the point to testnil
if there was no hit.
-(void)insertSublayer:(CALayer)aLayer above:(CALayer)aSublayer
aLayer
- the layer to insertaSublayer
- the layer to insert aboveCALayerNotFoundException
- if aSublayer
is not in the array of sublayers-(void)insertSublayer:(CALayer)aLayer atIndex:(unsigned)anIndex
aLayer
- the layer to insertanIndex
- the index to insert the layer at-(void)insertSublayer:(CALayer)aLayer below:(CALayer)aSublayer
aLayer
- the layer to insertaSublayer
- the layer to insert belowCALayerNotFoundException
- if aSublayer
is not in the array of sublayers-(BOOL)isHidden
YES
if the layer is hidden.-(BOOL)needsDisplayOnBoundsChange
YES
if the display should be redrawn on a bounds change.-(float)opacity
0.0
(transparent) and 1.0
(opaque).-(CGPoint)position
-(void)removeFromSuperlayer
-(void)replaceSublayer:(CALayer)aSublayer with:(CALayer)aLayer
aSublayer
- the layer to insertaLayer
- the layer to replace-(void)setAffineTransform:(CGAffineTransform)anAffineTransform
anAffineTransform
- the new affine transform-(void)setAnchorPoint:(CGPoint)anAnchorPoint
anAnchorPoint
- the layer's new anchor point-(void)setBackgroundColor:(CPColor)aColor
aColor
- the new background color-(void)setBackingStoreFrame:(CGRect)aFrame
aFrame
- the new backing store.-(void)setBounds:(CGRect)aBounds
aBounds
- the new bounds for the layer-(void)setContents:(CGImage)contents
contents
- the image to display-(void)setDelegate:(id)aDelegate
aDelegate
- the delegate-(void)setFrame:(CGRect)aFrame
aFrame
- the new frame rectangle-(void)setHidden:(BOOL)isHidden
isHidden
- YES
means the layer will be hidden. NO
means the layer will be visible.-(void)setMasksToBounds:(BOOL)masksToBounds
masksToBounds
- YES
hides the excess content. NO
makes it visible.-(void)setNeedsDisplay
-(void)setNeedsDisplayInRect:(CGRect)aRect
aRect
- the area that needs to be redrawn.-(void)setNeedsDisplayOnBoundsChange:(BOOL)needsDisplayOnBoundsChange
needsDisplayOnBoundsChange
- YES
means the display is redraw on a bounds change.-(void)setOpacity:(float)anOpacity
anOpacity
- the new opacity (between 0.0
(transparent) and 1.0
(opaque)).-(void)setPosition:(CGPoint)aPosition
aPosition
- the layer's new position-(void)setSublayerTransform:(CGAffineTransform)anAffineTransform
anAffineTransform
- the transform to apply to sublayers-(void)setZPosition:(int)aZPosition
aZPosition
- the layer's new z-ordering-(CGAffineTransform)sublayerTransform
-(CPArray)sublayers
-(CALayer)superlayer
Delegate Method Detail |
---|
-(void)drawLayer:(CALayer)layer inContext:(CGContextRef)ctx
CALayer
will
call this in place of its drawInContext:
.layer
- the layer to draw forctx
- the context to draw on-(void)displayLayer:(CALayer)layer
display
method
by implementing this method.layer
Created on Sat Sep 13 14:15:43 PDT 2008