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

Function DrawCharacter

ui/font.go:70–80  ·  view source on GitHub ↗
(dst draw.Image, x, y int, ch byte, c color.Color)

Source from the content-addressed store, hash-verified

68}
69
70func DrawCharacter(dst draw.Image, x, y int, ch byte, c color.Color) {
71 if ch < 32 || ch > 128 {
72 return
73 }
74 cx := int((ch-32)%16) * 16
75 cy := int((ch-32)/16) * 16
76 r := image.Rect(x, y, x+16, y+16)
77 src := &image.Uniform{c}
78 sp := image.Pt(cx, cy)
79 draw.DrawMask(dst, r, src, sp, fontMask, sp, draw.Over)
80}
81
82func DrawText(dst draw.Image, x, y int, text string, c color.Color) {
83 for i := range text {

Callers 1

DrawTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…