mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
- 实现 RichTextEffectBase 基类提供统一的标签命名和参数读取逻辑 - 添加 RichTextBlueEffect、RichTextGoldEffect、RichTextGreenEffect 和 RichTextRedEffect 颜色标记效果 - 添加 RichTextFadeInEffect、RichTextFlyInEffect、RichTextJitterEffect 和 RichTextSineEffect 动画效果 - 实现 DefaultRichTextEffectRegistry 默认效果注册表 - 创建 GfRichTextLabel 富文本标签宿主组件 - 添加 IRichTextEffectRegistry 效果注册表接口 - 实现 RichTextEffectEntry、RichTextEffectsController 和 RichTextProfile 配置管理类 - 添加 RichTextMarkup 语义化标签构建辅助方法 - 创建 RichTextMarkupTests 和 RichTextProfileTests 单元测试
24 lines
1.1 KiB
C#
24 lines
1.1 KiB
C#
namespace GFramework.Godot.Text;
|
|
|
|
/// <summary>
|
|
/// 富文本效果注册表,负责把配置中的效果键解析为可安装的 <see cref="RichTextEffect" /> 实例。
|
|
/// </summary>
|
|
public interface IRichTextEffectRegistry
|
|
{
|
|
/// <summary>
|
|
/// 根据指定配置创建完整的效果实例集合。
|
|
/// </summary>
|
|
/// <param name="profile">效果组合配置。</param>
|
|
/// <param name="animatedEffectsEnabled">当前是否允许字符级动态效果生效。</param>
|
|
/// <returns>可直接写入 <see cref="RichTextLabel.CustomEffects" /> 的效果实例集合。</returns>
|
|
IReadOnlyList<RichTextEffect> CreateEffects(RichTextProfile profile, bool animatedEffectsEnabled);
|
|
|
|
/// <summary>
|
|
/// 根据单个效果键创建对应效果实例。
|
|
/// </summary>
|
|
/// <param name="key">效果键。</param>
|
|
/// <param name="animatedEffectsEnabled">当前是否允许字符级动态效果生效。</param>
|
|
/// <returns>解析成功时返回效果实例;否则返回 <see langword="null" />。</returns>
|
|
RichTextEffect? CreateEffect(string key, bool animatedEffectsEnabled);
|
|
}
|