[optimize][painter] add upper and top painter layer

This commit is contained in:
monitor1394
2022-06-24 22:17:01 +08:00
parent 7c07499e44
commit 9a1c76c236
22 changed files with 215 additions and 80 deletions

View File

@@ -314,6 +314,22 @@ namespace XCharts.Runtime
return img;
}
public static void SetBackground(Image background, ImageStyle imageStyle)
{
if (background == null) return;
if (imageStyle.show)
{
background.sprite = imageStyle.sprite;
background.color = imageStyle.color;
background.type = imageStyle.type;
}
else
{
background.sprite = null;
background.color = Color.clear;
}
}
public static ChartLabel AddAxisLabelObject(int total, int index, string name, Transform parent,
Vector2 sizeDelta, Axis axis, ComponentTheme theme,
string content, Color autoColor, TextAnchor autoAlignment = TextAnchor.MiddleCenter)