THREE 自定义文字弹框
文字部分
- 这里采用将文字绘制到画布中,并将其用作Texture(纹理)
const textStyle = ( text ) => { let width = 512, height = 256; let canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height; let ctx = canvas.getContext('2d'); ctx.fillStyle = '#C3C3C3'; ctx.fillRect(0, 0, width, height);