Instance Property

containerFrame

A rectangle specifying the area in which SceneKit should lay out the text.

Declaration

@property(nonatomic) CGRect containerFrame;

Discussion

SceneKit can lay out a body of text to fit within a rectangular area. To do this, you must first use this property to define the area for text layout as a rectangle in the x- and y-axis dimensions of the text object’s local coordinate system. Then you use the wrapped, alignmentMode, and truncationMode properties to control how SceneKit fits the text into the container frame. Text layout begins in the upper left corner of the rectangle.

The default value of this property is CGRectZero, specifying that SceneKit should lay out the text on one line without wrapping or truncation.

Depending on the content and style of the text and the values of the wrapped, alignmentMode, and truncationMode properties, the text may not fit within the container frame after layout, or it may occupy a smaller area.

See Also

Managing Text Layout

wrapped

A Boolean value that specifies whether SceneKit wraps long lines of text.

alignmentMode

A constant that specifies how SceneKit horizontally aligns each line of text within its container.

truncationMode

A constant that specifies how SceneKit truncates text that is too long to fit its container.

textSize

The two-dimensional extent of the text after layout.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software