增加Background背景组件

This commit is contained in:
monitor1394
2020-05-21 08:32:52 +08:00
parent 116d931e45
commit 920c4ea2a5
14 changed files with 387 additions and 19 deletions

View File

@@ -727,6 +727,29 @@ namespace XCharts
return warningInfo;
}
/// <summary>
/// 是否可以开启背景组件。背景组件在chart受上层布局控制时无法开启。
/// </summary>
/// <returns></returns>
public bool CanShowBackgroundComponent()
{
return !m_IsControlledByLayout;
}
/// <summary>
/// 开启背景组件。背景组件在chart受上层布局控制时不适用。
/// </summary>
/// <param name="flag"></param>
public void EnableBackground(bool flag)
{
if (flag && !CanShowBackgroundComponent())
{
Debug.LogError("can't show background component:chart is controlled by LayoutGroup.");
return;
}
m_Background.show = flag;
}
public Vector3 GetTitlePosition()
{
return chartPosition + m_Title.location.GetPosition(chartWidth, chartHeight);