Peter hes
Peter hes

Reputation: 111

Draw a text inside MTKView

I started to work on a project that the old colleges used metal to draw a graph. I am looking for a fast solution to add a label inside this MTKView.

Here is what I have so far:

for coordinate in coordinates {
    let circleVertice = CircleVertex(x: coordinate, y: 200, radius: 20)
    rrIntervals += circleVertice.toVertices(perimeterPoints: perimeterPoints)
}

As you can see, I have the coordinate, it's the coordinate of the label that moves with graph until it goes out of the screen. For example, I want to add a label with string of "Test" here, what is the best and fastest way to add this label in this MTKView with this coordinate. This code inside of a subclass of MTKView class.

Upvotes: 1

Views: 273

Answers (0)

Related Questions