Contents

init(extruding:textOptions:extrusionOptions:)

Synchronously generates a 3D mesh from a string, with options for text layout and custom extrusions.

Declaration

@MainActor @preconcurrency convenience init(extruding string: AttributedString, textOptions: MeshResource.GenerateTextOptions = GenerateTextOptions(), extrusionOptions: MeshResource.ShapeExtrusionOptions = ShapeExtrusionOptions()) throws

Parameters

  • string:

    A string that contains text for the 3D mesh geometry.

  • textOptions:

    A configuration for rendering the text in 2D, before extrusion.

  • extrusionOptions:

    A configuration for extruding the text in 3D.

Discussion

You can use the method to make a 3D mesh of a string, control the text’s layout, chamfers, materials, and how to extrude the shape into 3D.

The generated text is scaled at a ratio of 72 points per meter.

[Image]

See Also

Creating a text mesh resource