我正在尝试使用extendscript在after effects中创建一个文本框,就像使用文本工具并单击并拖动一个框时的文本框一样。我能找到的每一个资源都只展示了如何在文本周围制作一个实际的方框,但我只想要一个文本框,这样当使用大号字体时,文本就会自动换行,不会超出合成的范围。这是我到目前为止所知道的:
function createText(text, startTime, endTime, font)
{
var textLayer = newComp.layers.addText(text);
var sourceText = textLayer.property("Source Text").value;
sourceText.fontSize = 200;
sourceText.font = font;
textLayer.property("Source Text").setValue(sourceText);
textLayer.startTime = startTime;
textLayer.inPoint = startTime;
textLayer.outPoint = endTime;
var textRect = textLayer.sourceRectAtTime(0,false);
textLayer.property("Position").setValue([newComp.width/2,newComp.height/2]);
textLayer.property("Scale").setValue([100,100]);
}我正在尝试创建的文本框类型:

发布于 2021-06-01 15:13:10
若要创建段落(框)文本图层,请使用addBoxText()方法而不是addText()。它接受指定文本框大小的参数[width, height]。
https://stackoverflow.com/questions/67772596
复制相似问题