MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin-Playground / drawsc

Method drawsc

plugin/draw/draw.go:384–396  ·  view source on GitHub ↗

绘制文字

(one *gg.Context, fontSize, drawX, rlineY float64, lineTexts []string)

Source from the content-addressed store, hash-verified

382
383// 绘制文字
384func (titlec *titleColor) drawsc(one *gg.Context, fontSize, drawX, rlineY float64, lineTexts []string) {
385 if titlec.isRandom {
386 titlec.randfill()
387 }
388 one.SetRGBA255(titlec.r, titlec.g, titlec.b, 85)
389 one.Fill() // 填充颜色
390 one.SetRGBA255(55, 55, 55, 255)
391 h := fontSize + rlineY - 3
392 for i := range lineTexts { // 逐行绘制文字
393 one.DrawString(lineTexts[i], drawX+fontSize/2, h)
394 h += fontSize + (fontSize / 4)
395 }
396}
397
398// 填充颜色
399func (titlec *titleColor) randfill() {

Callers 1

createPic2Method · 0.80

Calls 1

randfillMethod · 0.95

Tested by

no test coverage detected