Skip to content

YY.drawText(name, options)

  • 绘制文字和图片返回 canvas 对象
  • 参数
    • {String} name 文字
    • {Object} options 配置
      • {String} color 颜色
      • {Number} fontSize 字体大小
      • {Number} offset 文字和图片中间的偏移值 像素 px
      • {String} image 图片地址,非必须值
      • {number} imageSize 图片大小 非必须值
  • 返回值: HTMLCanvasElement
js
const canvas = YY.drawText(name, {
  fontSize: 35,
  color: "yellow",
  imageSize: 64,
  image: "./textures/companyTag(1).png",
});

This document is generated by vitepress and Edit by deyihu