MCPcopy Create free account
hub / github.com/fogleman/nes / DrawCenteredText

Function DrawCenteredText

ui/font.go:61–68  ·  view source on GitHub ↗
(dst draw.Image, text string, dx, dy int, c color.Color)

Source from the content-addressed store, hash-verified

59}
60
61func DrawCenteredText(dst draw.Image, text string, dx, dy int, c color.Color) {
62 rows := WordWrap(text, 15)
63 for i, row := range rows {
64 x := 128 - len(row)*8
65 y := 120 - len(rows)*12 + i*24
66 DrawText(dst, x+dx, y+dy, row, c)
67 }
68}
69
70func DrawCharacter(dst draw.Image, x, y int, ch byte, c color.Color) {
71 if ch < 32 || ch > 128 {

Callers 1

CreateGenericThumbnailFunction · 0.85

Calls 2

WordWrapFunction · 0.85
DrawTextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…