【天枢密卷】灯笼文字超框修改

dev_chengFeng
ZhangBiao 2021-04-09 14:48:01 +08:00
parent cb89c89435
commit 5de102eb06
2 changed files with 31 additions and 10 deletions

View File

@ -268,9 +268,9 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -61.659973, y: 672.91}
m_AnchoredPosition: {x: -61.659973, y: 753.8249}
m_SizeDelta: {x: 88.53003, y: 161.83}
m_Pivot: {x: 0.5, y: 0.5}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &7004274454127098571
CanvasRenderer:
m_ObjectHideFlags: 0
@ -523,7 +523,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -0.000014496529, y: 50}
m_AnchoredPosition: {x: 0.000012327255, y: 50}
m_SizeDelta: {x: 0, y: 100}
m_Pivot: {x: 1, y: 0.5}
--- !u!114 &455843809901100221
@ -1005,11 +1005,11 @@ RectTransform:
m_Father: {fileID: 4337632453246120809}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -123.79999, y: 633.1}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 416.2, y: -85.900024}
m_SizeDelta: {x: 218, y: 482}
m_Pivot: {x: 0.5, y: 0.5}
m_Pivot: {x: 0.5, y: 1}
--- !u!222 &7259500788664693753
CanvasRenderer:
m_ObjectHideFlags: 0
@ -1039,7 +1039,7 @@ MonoBehaviour:
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 21300000, guid: 695ae3ce27a95be44a1b379fd0f20d20, type: 3}
m_Type: 0
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4

View File

@ -45,6 +45,8 @@ function TianShuMiJuanMainPanel:InitComponent()
local v21 = grid.transform.rect
self.scroll = SubUIManager.Open(SubUIConfig.ScrollCycleView,grid.transform,self.fetterItem,nil,Vector2.New(v21.width, v21.height), 1, 1, Vector2.New(0,25))
self.empty = Util.GetGameObject(self.gameObject,"bg/NoneImage")
self.Image = Util.GetGameObject(self.gameObject,"bg/static/Image (1)"):GetComponent("RectTransform")
end
function TianShuMiJuanMainPanel.SetTabAdapter(newTab, index, status)
@ -108,7 +110,7 @@ function TianShuMiJuanMainPanel:BindEvent()
curShai = curShai%3
self.shaiText.text = status[curShai]
curData = self:ShaiData()
self:RefreshData(curData)
self:RefreshData(curData)
end)
self.tabBox = TabBox.New()
self.tabBox:SetTabAdapter(self.SetTabAdapter)
@ -145,7 +147,8 @@ function TianShuMiJuanMainPanel:OnShow()
self:RefreshData()
end
function TianShuMiJuanMainPanel:RefreshData()
function TianShuMiJuanMainPanel:RefreshData()
self:ChengeSize()
self:SortData()
self.scroll:ForeachItemGO(function(index,go)
go.gameObject:SetActive(false)
@ -161,6 +164,24 @@ function TianShuMiJuanMainPanel:RefreshData()
end
end
--灯笼大小变化
function TianShuMiJuanMainPanel:ChengeSize()
if GetCurLanguage() == 0 then return end
local width = GetPreferredWidth(self.shaiText.transform)
local vec = self.Image.transform.sizeDelta
local shaiVect = self.shai:GetComponent("RectTransform").transform.sizeDelta
if width > 120 then
vec.y = width + 400
shaiVect.y = width + 50
else
vec.y = 482
shaiVect.y = 161
end
self.Image.transform.sizeDelta = vec
self.shai:GetComponent("RectTransform").transform.sizeDelta = shaiVect
end
function TianShuMiJuanMainPanel:ShaiData()
if not data or #data < 1 then
return