我尝试将画布的宽度和高度更改为以下
createText(text = 'example') {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = 256;
canvas.height = 64;
ctx.fillStyle = '#796e8c';
ctx.fillRect(0, 0, 600, 600);
ctx.font='120px Arial';
ctx.fillStyle = '#000000';
ctx.fillText(text, 30, 100);
const canvasTexture = new THREE.CanvasTexture(canvas);
const spriteMaterail = new THREE.SpriteMaterial({
map: canvasTexture,
color: 0xffffff
});
const sprite = new THREE.Sprite(spriteMaterail);
return sprite;
}
,但是大小和比例总是一样的