Platforms to show: All Mac Windows Linux Cross-Platform
CALayerMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | CoreAnimation | MBS MacCG Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The CALayer class manages image-based content and allows you to perform animations on that content. Layers are often used to provide the backing store for views but can also be used without a view to display content. A layer's main job is to manage the visual content that you provide but the layer itself has visual attributes that can be set, such as a background color, border, and shadow. In addition to managing visual content, the layer also maintains information about the geometry of its content (such as its position, size, and transform) that is used to present that content onscreen. Modifying the properties of the layer is how you initiate animations on the layer's content or geometry. A layer object encapsulates the duration and pacing of a layer and its animations by adopting the CAMediaTiming protocol, which defines the layer's timing information.
If the layer object was created by a view, the view typically assigns itself as the layer's delegate automatically, and you should not change that relationship. For layers you create yourself, you can assign a delegate object and use that object to provide the contents of the layer dynamically and perform other tasks. A layer may also have a layout manager object (assigned to the layoutManager property) to manage the layout of subviews separately.
Available in OS X v10.5 and later.
- 41 properties
- property affineTransform as CGAffineTransformMBS
- property anchorPoint as CGRectMBS
- property anchorPointZ as Double
- property AutoresizingMask as Integer
- property backgroundColor as Variant
- property borderColor as Variant
- property borderWidth as Double
- property bounds as CGRectMBS
- property className as string
- property classPath as string
- property contents as Variant
- property contentsCenter as CGRectMBS
- property contentsRect as CGRectMBS
- property contentsScale as Double
- property cornerRadius as Double
- property DoubleSided as boolean
- property drawsAsynchronously as boolean
- property frame as CGRectMBS
- property Handle as Integer
- property Hidden as boolean
- property mask as CALayerMBS
- property masksToBounds as Boolean
- property minificationFilterBias as Double
- property modelLayer as CALayerMBS
- property needsDisplay as boolean
- property needsDisplayOnBoundsChange as boolean
- property needsLayout as boolean
- property opacity as Double
- property Opaque as boolean
- property position as CGRectMBS
- property preferredFrameSize as CGSizeMBS
- property presentationLayer as CALayerMBS
- property rasterizationScale as Double
- property shadowColor as Variant
- property shadowOffset as CGSizeMBS
- property shadowOpacity as Double
- property shadowPath as Variant
- property shadowRadius as Double
- property shouldRasterize as Boolean
- property superlayer as CALayerMBS
- property zPosition as Double
- 14 methods
- method addSublayer(layer as CALayerMBS)
- method Constructor
- method display
- method displayIfNeeded
- method layoutIfNeeded
- method layoutSublayers
- method removeAllAnimations
- method removeFromSuperlayer
- method renderInContext(CGContextHandle as Integer) as boolean
- method renderInPicture(Pic as Picture) as boolean
- method setNeedsDisplay
- method setNeedsDisplayInRect(r as CGRectMBS)
- method setNeedsLayout
- method sublayers as CALayerMBS()
- 4 shared methods
- shared method available as boolean
- shared method layer as CALayerMBS
- shared method layerFromHandle(Handle as Integer) as CALayerMBS
- shared method layerFromHandle(Handle as Ptr) as CALayerMBS
- 11 constants
Edge constants
Constant | Value | Description |
---|---|---|
kCALayerBottomEdge | 4 |
Specifies that the bottom edge of the receiver's content should be antialiased. |
kCALayerLeftEdge | 1 |
Specifies that the left edge of the receiver's content should be antialiased. |
kCALayerRightEdge | 2 |
Specifies that the right edge of the receiver's content should be antialiased. |
kCALayerTopEdge | 8 |
Specifies that the top edge of the receiver's content should be antialiased. |
Autoresize Mask Constants
Constant | Value | Description |
---|---|---|
kCALayerHeightSizable | 16 |
The receiver's height is flexible. |
kCALayerMaxXMargin | 4 |
The left margin between the receiver and its superview is flexible. |
kCALayerMaxYMargin | 32 |
The top margin between the receiver and its superview is flexible. |
kCALayerMinXMargin | 1 |
The left margin between the receiver and its superview is flexible. |
kCALayerMinYMargin | 8 |
The top margin between the receiver and its superview is flexible. |
kCALayerNotSizable | 0 |
The receiver cannot be resized. |
kCALayerWidthSizable | 2 |
The receiver's width is flexible. |
Sub classes:
- class AVCaptureVideoPreviewLayerMBS
- class AVPlayerLayerMBS
- class AVSampleBufferDisplayLayerMBS
- class AVSynchronizedLayerMBS
- class CATextLayerMBS
Some methods using this class:
- AVVideoCompositionCoreAnimationToolMBS.videoCompositionCoreAnimationToolWithAdditionalLayer(layer as CALayerMBS, trackID as Integer) as AVVideoCompositionCoreAnimationToolMBS
- AVVideoCompositionCoreAnimationToolMBS.videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer(videoLayer as CALayerMBS, animationLayer as CALayerMBS) as AVVideoCompositionCoreAnimationToolMBS
- AVVideoCompositionCoreAnimationToolMBS.videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayers(videoLayers() as CALayerMBS, animationLayer as CALayerMBS) as AVVideoCompositionCoreAnimationToolMBS
- Control.CALayerMBS as CALayerMBS
- DesktopControl.CALayerMBS as CALayerMBS
- IKImageBrowserCellMBS.layerForType(type as string) as CALayerMBS
- SCNMaterialPropertyMBS.materialPropertyWithLayer(layer as CALayerMBS) as SCNMaterialPropertyMBS
Some properties using for this class:
- CALayerMBS.mask as CALayerMBS
- CALayerMBS.modelLayer as CALayerMBS
- CALayerMBS.presentationLayer as CALayerMBS
- CALayerMBS.superlayer as CALayerMBS
- IKImageBrowserViewMBS.backgroundLayer as CALayerMBS
- IKImageBrowserViewMBS.foregroundLayer as CALayerMBS
Some examples using this class:
- /AVFoundation/Add text to video
- /AVFoundation/Donut Video Player
- /AVFoundation/Donut Video Player Overlay
- /AVFoundation/Live Barcode Detection
- /AVFoundation/Live Barcode Detection iOS/Live Barcode Detection iOS
- /AVFoundation/Recorder
- /AVFoundation/Screen Input
- /AVFoundation/Simple Player
- /AVFoundation/Still Photos
- /AVFoundation/Transparent Player
Blog Entries
- MBS Xojo Plugins, version 22.2pr2
- MBS Xojo Plugins, version 21.4pr2
- MBS Xojo / Real Studio Plugins, version 16.1pr3
- MBS Xojo / Real Studio Plugins, version 15.3pr3
- MBS Xojo / Real Studio Plugins, version 15.0pr12
- MBS Xojo / Real Studio Plugins, version 14.5pr2
- MBS Real Studio Plugins, version 13.1pr13
- MBS Real Studio Plugins, version 13.1pr9
Release notes
- Version 22.2
- Corrected declaration of autoresizingMask in CALayerMBS to correctly state as not supported for iOS.
- Version 21.4
- Fixed problem with borderColor assignment in CALayerMBS class not working.
The items on this page are in the following plugins: MBS AVFoundation Plugin, MBS MacCG Plugin.
CalAttendeeMBS - CalCalendarItemMBS