Replies: 1 comment 2 replies
-
It is possible to draw text on a canvas as shown in the example below. I will make the API simpler for this and add documentation to the website soon. core.NewCanvas(b).SetDraw(func(pc *paint.Context) {
txt := &paint.Text{}
fr := &styles.FontRender{}
fr.Defaults()
stx := &styles.Text{}
stx.Defaults()
txt.SetHTML("Hello, world", fr, stx, &pc.UnitContext, nil)
txt.Layout(stx, fr, &pc.UnitContext, math32.Vec2(50, 50))
txt.Render(pc, math32.Vec2(10, 10))
}) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I cant find any function to draw text on a canvas ??
Beta Was this translation helpful? Give feedback.
All reactions