---
title: "init(text:textColor:backgroundColor:alignment:)"
framework: carplay
role: symbol
role_heading: Initializer
path: "carplay/cpimageoverlay/init(text:textcolor:backgroundcolor:alignment:)"
---

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

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

## Declaration

```swift
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.
