【发布时间】:2025-12-31 18:25:02
【问题描述】:
我正在尝试使用扩展脚本在后效中创建一个文本框,就像您使用文本工具并单击并拖动一个框时的文本框一样。我能找到的每个资源都只显示了如何在文本周围制作一个实际的框,但我只想要文本框,以便在使用大字体时文本可以换行并且不会超出合成的范围。这是我目前所拥有的:
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]);
}
【问题讨论】:
标签: javascript adobe extendscript after-effects