配置参考
Texturge 的配置通过 UE 标准的 UDeveloperSettings 机制管理,可在项目设置面板中修改。
配置位置
- 编辑器面板:
Edit > Project Settings > Texturge
- 配置文件:
{ProjectRoot}/Config/DefaultGame.ini(对应 USettings 类的 config = Game 标记)
- 类名:
USettings(继承 UDeveloperSettings)
访问配置
// C++ 中获取配置单例
USettings* Settings = USettings::Get();
蓝图配置
文本动画的核心配置不在插件设置中,而是在 UTextAnimInstance 的**类默认值(Class Defaults)**中。这些值在动画蓝图中编辑后,所有实例共用:
预览视口
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewWidth | float | 500.0 | 预览容器宽度限制 |
PreviewHeight | float | 200.0 | 预览容器高度限制(0 = 不限制) |
bPreviewSizeToContent | bool | false | 容器自动适配文本内容大小 |
预览文本
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewText | FString | "Hello Texturge" | 编辑器中预览动画时使用的文本 |
颜色与外观
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewColorAndOpacity | FLinearColor | White | 文本颜色和不透明度 |
PreviewMinDesiredWidth | float | 0.0 | 文本区域最小期望宽度 |
字体
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewFont | UFont* | nullptr | 预览字体资产(替换默认字体) |
PreviewLetterSpacing | int32 | 0 | 字符间距 |
PreviewFontMaterial | UMaterialInterface* | nullptr | 字体材质(自定义渲染效果) |
轮廓
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewOutlineSize | float | 0.0 | 文本轮廓描边大小(像素) |
PreviewOutlineColor | FLinearColor | Transparent | 文本轮廓描边颜色 |
阴影
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewShadowOffset | FVector2D | (0, 0) | 文本阴影偏移 |
PreviewShadowColorAndOpacity | FLinearColor | Transparent | 文本阴影颜色和不透明度 |
对齐与换行
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewTextTransformPolicy | ETextTransformPolicy | None | 文本变换规则(大写/小写) |
PreviewJustification | ETextJustify::Type | Left | 文本对齐方式 |
bPreviewAutoWrapText | bool | false | 文本超出区域自动换行 |
PreviewWrapTextAt | float | 0.0 | 强制换行宽度(0 = 不限制) |
PreviewWrappingPolicy | ETextWrappingPolicy | DefaultWrapping | 文本包裹规则策略 |
行高与边距
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewLineHeightPercentage | float | 1.0 | 行高百分比 |
bPreviewApplyLineHeightToBottomLine | bool | false | 是否应用到末行 |
PreviewMargin | FMargin | (0) | 文本块内边距 |
渲染
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewClipping | EWidgetClipping | Inherit | 控件剪裁模式 |
bPreviewPixelSnapping | bool | true | 像素对齐(减少模糊) |
PreviewRenderOpacity | float | 1.0 | 控件整体渲染不透明度 |
溢出与流方向
| 属性 | 类型 | 默认值 | 说明 |
|---|
PreviewFlowDirection | EFlowDirectionPreference | Inherit | 文本流方向偏好 |
PreviewTextOverflowPolicy | ETextOverflowPolicy | Clip | 文本溢出处理策略 |
运行时参数
在运行时可通过蓝图/C++ 动态调整动画参数,无需修改配置:
// 设置运行时浮点参数
void UTextAnimInstance::SetParameter(FName Name, float Value);
// 设置轨道权重
void UTextAnimInstance::SetTrackWeight(const FGuid& TrackId, float Weight);
这些运行时参数存储于 RuntimeParameters 和 RuntimeTrackWeights 映射中,在 EvaluateTime() 时与编译数据合并求值。
images/project-settings.png — Project Settings 窗口左侧选中 Texturge 分类(Game 分组),右侧显示插件配置选项