调用方式
addon:CreateConditionLabel()
可直接通过 addon 使用,无需依赖项。
作用
创建原生的自动换行文本,根据其宽度和字体测量高度。SetText、SetFont 或 SetFontObject 用于配置其内容。将其使用 parent:AddChild(widget) 添加到回调的父级,以便布局能够跟踪其测得的高度。
参数
| 名称 | 类型 | 作用 |
|---|---|---|
self | RMAddon | Rotation Master 插件实例(使用冒号调用时隐含传入)。 |
返回值
| 1 | RMConditionLabel | 带有字体、颜色和对齐方法的原生自动换行文本控件。 |
|---|
版本
内置辅助函数在每个版本上都会注册。不同的是它们读取的游戏 API;某个 API 缺失时,辅助函数会改用后备方案,或返回 nil 并附上原因。
它不直接读取任何游戏 API。
插件如何调用它
- 副本 (widget)
local note = addon:CreateConditionLabel() - 已雕刻符文 (widget)
local label = addon:CreateConditionLabel() - 武器附魔类型 (widget)
local label = addon:CreateConditionLabel() Conditions.bossmod.notelocal label = addon:CreateConditionLabel()Conditions.talent.textlocal label=addon:CreateConditionLabel();label:SetFullWidth(true);label:SetText(message);parent:AddChild(label)Conditions.talent.traitsWidgetlocal note=addon:CreateConditionLabel();note:SetFullWidth(true);parent:AddChild(note)
依赖项
labelConstructor→UI.condition_display.labelConstructor
源码
UI/condition_display.lua,第 144 行。在游戏中为只读;“复制”会生成一份可编辑的副本。
UI.condition_display.CreateConditionLabel(self)
return self:AcquireConditionWidget('RM-ConditionLabel',labelConstructor)