<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPImageOverlay/init(text:textColor:backgroundColor:alignment:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPImageOverlay(im)initWithText:textColor:backgroundColor:alignment:"
  },
  "title" : "init(text:textColor:backgroundColor:alignment:)"
}
-->

# init(text:textColor:backgroundColor:alignment:)

Initialize an overlay with properties that control the overlay’s appearance and text contents.

```
init(text: String, textColor: UIColor, backgroundColor: UIColor, alignment: CPImageOverlay.Alignment)
```

## Parameters

`text`

The text to display in the overlay.

`textColor`

The color of the overlay text.

`backgroundColor`

The background color of the overlay.

`alignment`

The alignment for positioning the overlay.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)