local function animScale(anim)
if anim and anim.isSFX then --isSFX判断是否是特效
local scaleX, scaleY = 1, 1
if anim.configW and anim.configW > 0 then
scaleX = anim.configW
end
if anim.
```lua
local function animScale(anim) -- 定义缩放动画函数
if anim and anim.isSFX then -- 判断anim存在且是特效
local scaleX, scaleY = 1, 1 -- 初始化缩放比例为1
if anim.configW and anim.configW > 0 then -- 如果配置宽度存在且大于0
scaleX = anim.configW -- 设置X轴缩放为配置宽度
end
if anim.configH and anim.configH > 0 then -- 如果配置高度存在且大于0
scaleY = anim.configH -- 设置Y轴缩放为配置高度
end
GUI:setScaleX(anim, scaleX) -- 应用X轴缩放
GUI:setScaleY(anim, scaleY) -- 应用Y轴缩放
if anim.order and anim.order == 0 then -- 如果order存在且等于0
GUI:setLocalZOrder(anim, -1) -- 设置渲染层级为-1(底层)
end
end
end
local function addFrameDesc(desc, frameChilds) -- 添加帧描述信息函数
if desc and next(desc) then -- 判断desc存在且非空
for i, v in ipairs(desc) do -- 遍历desc数组
if v.newLine then -- 如果是换行标记
local lineH = v.height or 0 -- 获取行高,默认0
lineH = lineH > 0 and lineH or _DefaultSpace -- 行高大于0则使用,否则用默认间距
local linePanel = ItemTips.CreateIntervalPanel(parent, lineH, true) -- 创建间隔面板
GUI:setPosition(linePanel, v.x or 0, v.y or 0) -- 设置面板位置
if frameChilds then -- 如果frameChilds存在
table.insert(frameChilds, linePanel) -- 将面板插入子控件列表
end
elseif v.text then -- 如果是文本内容
rich_att_num = rich_att_num + 1 -- 富文本计数器加1
local textSize = _setFontSize or _DefaultFSize -- 获取字体大小,默认用预设值
if v.fontsize and v.fontsize > 0 then -- 如果指定了字体大小且大于0
textSize = v.fontsize -- 使用指定的字体大小
end
local rich_att = GUI:RichTextFCOLOR_Create(parent, string.format("rich_att_%s", rich_att_num), -- 创建富文本控件
math.floor(v.x or 0), math.floor(v.y or 0), v.text, -- 位置和文本内容
ItemTips._isItem and 420 or (_TotalWidth - 20), textSize, "#FFFFFF", vspace, nil, fontPath) -- 宽度、大小、颜色等参数
if frameChilds then -- 如果frameChilds存在
table.insert(frameChilds, rich_att) -- 将富文本插入子控件列表
end
elseif v.res then -- 如果是资源(图片/特效)
desc_img_num = desc_img_num + 1 -- 图片计数器加1
local img = ItemTips.GetNodeImage(parent, v, desc_img_num) -- 获取图片节点
if img and frameChilds then -- 如果图片存在且frameChilds存在
img.isSFX = v.isSFX -- 标记是否为特效
img.configW = v.width -- 记录配置宽度
img.configH = v.height -- 记录配置高度
img.order = v.frameOrder -- 记录渲染顺序
table.insert(frameChilds, img) -- 将图片插入子控件列表
end
end
end
end
end
```