local XMovieActionCenterTips = XClass(XMovieActionBase, "XMovieActionCenterTips")
function XMovieActionCenterTips:Ctor(actionData)
local params = actionData.Params
self.Content = params[1]
self.IsHide = params[2] == "1"
self.FontSize = params[3]
self.FontColor = params[4]
self.IsLeft = params[5] == "1"
end
function XMovieActionCenterTips:OnInit()
self.UiRoot.PanelCenterTip.gameObject:SetActiveEx(not self.IsHide)
if self.IsHide then
return
end
local content = self.Content
if self.FontSize and self.FontColor then
content = string.format("%s", self.FontSize, self.FontColor, self.Content)
elseif self.FontSize then
content = string.format("%s", self.FontSize, self.Content)
elseif self.FontColor then
content = string.format("%s", self.FontColor, self.Content)
end
self.UiRoot.TxtCenterTipDescMid.text = content
self.UiRoot.TxtCenterTipDescMid.gameObject:SetActiveEx(not self.IsLeft)
self.UiRoot.TxtCenterTipDescLeft.text = content
self.UiRoot.TxtCenterTipDescLeft.gameObject:SetActiveEx(self.IsLeft)
end
return XMovieActionCenterTips