---
title: "draw(_:at:anchor:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/graphicscontext/draw(_:at:anchor:)-6xr87"
---

# draw(_:at:anchor:)

Draws resolved text into the context, aligning an anchor within the ideal size of the text to a point in the context.

## Declaration

```swift
func draw(_ text: GraphicsContext.ResolvedText, at point: CGPoint, anchor: UnitPoint = .center)
```

## Parameters

- `text`: The doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/ResolvedText to draw. Get resolved text from a doc://com.apple.SwiftUI/documentation/SwiftUI/Text view by calling doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/resolve(_:)-4dx65. Alternatively, you can call doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext/draw(_:at:anchor:)-5dgmd with a doc://com.apple.SwiftUI/documentation/SwiftUI/Text view, and that method performs the resolution automatically.
- `point`: A point within the rectangle of the ideal size of the resolved text to anchor to a point in the context.
- `anchor`: A doc://com.apple.SwiftUI/documentation/SwiftUI/UnitPoint within the context to align the text with. The default is doc://com.apple.SwiftUI/documentation/SwiftUI/UnitPoint/center.

## Discussion

Discussion The current context state defines the full drawing operation. For example, the current transformation and clip shapes affect how SwiftUI draws the text.
