显示fix
This commit is contained in:
parent
68f9a47e00
commit
f47a35f2e7
@ -1355,6 +1355,18 @@ function GFunc.centerImgAndTx(imgObj, txObj, spacing, offset)
|
||||
txObj:setAnchoredPositionX(w - txW / 2 + offset)
|
||||
end
|
||||
|
||||
-- centerImgAndTx的位置反向版本
|
||||
function GFunc.centerTxAndImg(txObj, imgObj, spacing, offset)
|
||||
spacing = spacing or 0
|
||||
offset = offset or 0
|
||||
local imgW = imgObj:getSizeDelta().x
|
||||
local txW = txObj:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
|
||||
txObj:setSizeDeltaX(txW)
|
||||
local w = (imgW + txW + spacing) / 2
|
||||
txObj:setAnchoredPositionX(txW / 2 - w + offset)
|
||||
imgObj:setAnchoredPositionX(w - imgW / 2 + offset)
|
||||
end
|
||||
|
||||
function GFunc.centerTxAndTx(txObj1, txObj2, spacing)
|
||||
spacing = spacing or 0
|
||||
local txW = txObj1:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
|
||||
|
||||
@ -138,6 +138,8 @@ function DungeonDifficultyUI:refreshDifficulty()
|
||||
self.iconBuff:addClickListener(function()
|
||||
ModuleManager.TipsManager:showDescTips(GFunc.getBuffDesc(buff.type, buff.num), self.iconBuff)
|
||||
end)
|
||||
|
||||
GFunc.centerTxAndImg(self.txbuff, self.iconBuff, 5)
|
||||
else
|
||||
self.buffObj:setActive(false)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user