public ImGui(GuiBuilder gui, Padding padding, RectAllocator defaultAllocator = RectAllocator.Stretch, bool clip = false) { this.gui = gui; if (gui == null) { action = ImGuiAction.Build; } this.defaultAllocator = defaultAllocator; this.clip = clip; initialPadding = padding; }
public Context EnterGroup(Padding padding, RectAllocator allocator, SchemeColor textColor = SchemeColor.None, float spacing = float.NegativeInfinity) { state.AllocateSpacing(); var ctx = new Context(this, padding); state.allocator = allocator; if (!float.IsNegativeInfinity(spacing)) { state.spacing = spacing; } if (textColor != SchemeColor.None) { state.textColor = textColor; } return(ctx); }
public ImGui RemainingRow(float spacing = float.NegativeInfinity) { state.AllocateSpacing(spacing); allocator = RectAllocator.RemainigRow; return(this); }
public Context EnterRow(float spacing = 0.5f, RectAllocator allocator = RectAllocator.LeftRow, SchemeColor textColor = SchemeColor.None) => EnterGroup(default, allocator, textColor, spacing);
public static bool BuildCheckBox(this ImGui gui, string text, bool value, out bool newValue, SchemeColor color = SchemeColor.None, RectAllocator allocator = RectAllocator.LeftRow) { using (gui.EnterRow(allocator: allocator)) { gui.BuildIcon(value ? Icon.CheckBoxCheck : Icon.CheckBoxEmpty, 1.5f, color); gui.BuildText(text, Font.text, color: color); } if (gui.OnClick(gui.lastRect)) { newValue = !value; return(true); } newValue = value; return(false); }