public void buildInfo() { var panel = new CUIPeace { panelName = ui_name, color = UIColors["black"], aMax = aMaxInfo, aMin = aMinInfo, horizontal = "0 1", vertical = ".93 1" }; CUIBuild.CreatePanel(panel, ref maincont); panel.horizontal = "0 1"; panel.vertical = "0 .07"; CUIBuild.CreatePanel(panel, ref maincont); panel.horizontal = "0 1"; panel.vertical = ".07 .3"; panel.color = UIColors["orange"]; CUIBuild.CreatePanel(panel, ref maincont); panel.horizontal = ".2 .8"; panel.vertical = ".4 .8"; panel.color = UIColors["orange"]; panel.ipath = "http://www.rigormortis.be/wp-content/uploads/rust-icon-512.png"; CUIBuild.LoadImage(panel, ref maincont); //CUIBuild.CreateLabel(ref maincont, ui_name, UIColors["white_pink"], target.ToString(), 18, ".153 .47", ".36 .5"); }
static public void LoadImage(CUIPeace panel, ref CuiElementContainer container) { if (panel.ipath.StartsWith("http") || panel.ipath.StartsWith("www")) { container.Add(new CuiElement { Parent = panel.panelName, Components = { new CuiRawImageComponent { Url = panel.ipath }, new CuiRectTransformComponent { AnchorMin = panel.aMin, AnchorMax = panel.aMax } } }); } else { container.Add(new CuiElement { Parent = panel.panelName, Components = { new CuiRawImageComponent { Png = panel.ipath }, new CuiRectTransformComponent { AnchorMin = panel.aMin, AnchorMax = panel.aMax } } }); } }
public void buildOverlay() { CUIBuild.setMaterial("assets/content/ui/uibackgroundblur-ingamemenu.mat"); maincont = CUIBuild.CreateContainer("menu", ".1 .1 .1 .5", "0 0", "1 1", true); CUIBuild.setMaterial("default"); var panel = new CUIPeace { panelName = ui_name, color = UIColors["black_alpha"], aMax = aMaxInfo, aMin = aMinInfo }; CUIBuild.CreatePanel(panel, ref maincont); panel.aMin = aMinTp; panel.aMax = aMaxTp; CUIBuild.CreatePanel(panel, ref maincont); panel.aMin = aMinBody; panel.aMax = aMaxBody; CUIBuild.CreatePanel(panel, ref maincont); }
static public void CreatePanel(CUIPeace panel, ref CuiElementContainer container) { container.Add(new CuiPanel { Image = { Color = panel.color, Material = material }, RectTransform = { AnchorMin = panel.horizontal, AnchorMax = panel.vertical }, CursorEnabled = panel.cursor }, panel.panelName); }