Тьомчик
-
Автор темы
- #1
insane code with comments:
using namespace ImGui;
fn func() {
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return;
const ImGuiContext& get_ctx = *GImGui;
const ImGuiStyle& get_style = get_ctx.Style;
const ImGuiID get_name_id = window->GetID(name.c_str());
const ImVec2 get_name_size = CalcTextSize(name.c_str(), NULL, true);
const float width = /* custom_value */;
const float height = /* custom_value */ ;
const ImVec2 get_cursor_position = window->DC.CursorPos;
const ImRect select_place(get_cursor_position + ImVec2( /* get min range start from zone. Position from left side from X, position from left upper side from X. [I]/ ), get_cursor_position + ImVec2( /[/I] our max range. */ width, height));
const ImRect absolute_position(select_place.Min /* take a left side. [I]/, /[/I] take a right side. UPD: here we can remove or add if u need call scrollbar or another elements in GUI */ select_place.Max);
/* create item size for our elements for stop ruin another staff */
ItemSize(absolute_position, /* custom_value [I]/ /[/I] additional size for y. which we cannot interact */);
/* bind our size and position to our element ID */
if (!ItemAdd(absolute_position, get_name_id, &select_place))
return;
/* if we create button */
bool hold, release_on;
bool clicked = ButtonBehavior(absolute_position, get_name_id, &hold, &release_on);
if (clicked) {
}
/*
Here we write render elements, text and another.
Function.
Create & holding our temp. return value and otc.
After drawing and another u can call NewLine, Spacing, Dummy which create a new space beetwen or after elements.
*/
}