public static void EndBoarder() { Vector2 size = new Vector2(ImGui.GetContentRegionAvail().X, ImGui.GetCursorScreenPos().Y - _startPos.Y); //ImGui.get ImDrawListPtr wdl = ImGui.GetWindowDrawList(); Vector2[] pts = new Vector2[6]; pts[0] = new Vector2(_startPos.X + 2, _startPos.Y); pts[1] = _startPos; //top left pts[2] = new Vector2(_startPos.X, _startPos.Y + size.Y); //bottom left pts[3] = new Vector2(_startPos.X + size.X + 3, _startPos.Y + size.Y); //bottom right pts[4] = new Vector2(_startPos.X + size.X + 3, _startPos.Y); pts[5] = new Vector2(_startPos.X + _labelSize.X + 3, _startPos.Y); wdl.AddPolyline(ref pts[0], pts.Length, _colour, false, 1.0f); ImGui.PopID(); }
/* * public static void Begin(string id, ref int selected, string[] list) * { * Begin(id, list, ref selected, ImGui.GetColorU32(ImGuiCol.Border)); * } * * public static void Begin(string id, string[] list, ref int selected, ImGuiCol colorIdx) * { * Begin(id, list, ref selected, ImGui.GetColorU32(colorIdx)); * } */ public static void End(Vector2 sizeRight) { ImGui.Unindent(_dentMulitpier * _nestIndex); _nestIndex--; var state = _states[_nestIndex]; var winpos = ImGui.GetCursorPos(); var rgnSize = ImGui.GetContentRegionAvail(); ImGui.NextColumn(); ImGui.Columns(1); var scpos = ImGui.GetCursorScreenPos(); ImGui.Unindent(_dentMulitpier); state._xright = state._xcentr + sizeRight.X; float boty = Math.Max(state._ybot, state._ytop + sizeRight.Y); //is the list bigger, or the items drawn after it. ImDrawListPtr wdl = ImGui.GetWindowDrawList(); Vector2[] pts = new Vector2[9]; pts[0] = new Vector2(state._xleft, state._yctr1); //topleft of the selected item pts[1] = new Vector2(state._xleft, state._yctr2); //botomleft of the selected item pts[2] = new Vector2(state._xcentr, state._yctr2); //bottom rigth of selected item pts[3] = new Vector2(state._xcentr, boty); //bottom left of rh colomn pts[4] = new Vector2(state._xright, boty); //bottom Right pts[5] = new Vector2(state._xright, state._ytop); //top righht pts[6] = new Vector2(state._xcentr, state._ytop); //top mid pts[7] = new Vector2(state._xcentr, state._yctr1); //selected top right pts[8] = pts[0]; //selected top left wdl.AddPolyline(ref pts[0], pts.Length, state._colour, false, 1.0f); ImGui.PopID(); }
public static void End(float width) { ImGui.Unindent(_dentMulitpier * _nestIndex); _nestIndex--; var pos = ImGui.GetCursorScreenPos(); _size[_nestIndex] = new Vector2(width, pos.Y - _startPos[_nestIndex].Y); ImDrawListPtr wdl = ImGui.GetWindowDrawList(); float by = _startPos[_nestIndex].Y + _size[_nestIndex].Y + _dentMulitpier - _dentMulitpier * _nestIndex; float rx = _startPos[_nestIndex].X + _size[_nestIndex].X - _dentMulitpier * _nestIndex; Vector2[] pts = new Vector2[6]; pts[0] = new Vector2(_startPos[_nestIndex].X + _dentMulitpier, _startPos[_nestIndex].Y); pts[1] = _startPos[_nestIndex]; //top left pts[2] = new Vector2(_startPos[_nestIndex].X, by); //bottom left pts[3] = new Vector2(rx, by); //bottom right pts[4] = new Vector2(rx, _startPos[_nestIndex].Y); //top right pts[5] = new Vector2(_startPos[_nestIndex].X + _labelSize[_nestIndex].X + _dentMulitpier, _startPos[_nestIndex].Y); wdl.AddPolyline(ref pts[0], pts.Length, _colour[_nestIndex], false, 1.0f); ImGui.PopID(); }