-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inquiry #26
Comments
There isnt really a titltle as such. You are responsible for rendering it. You may edit text input in place of title if you desire. Ez namespace renders just a text. Ez is more of an example how to use low level library functions rather than a code intended for consumption, but you can copy it and customize node rendering to your liking.
I suppose you mean slots? Slots are differentiated by you passing a number representing slot kind. For example you could have an enum defining all kinds of slots. You can connect slots that have a matching slot kind. There is no way to connect two slots with different kinds, however.
sample.cpp has an example of that. You keep a |
Thank you! |
So to not create a new issue. In the sample it says that the order is important for ImNodes::Ez::InputSlots(node->m_in_slots.data(), node->m_in_slots.size());
// draw node content
ImNodes::Ez::OutputSlots(node->m_out_slots.data(), node->m_out_slots.size()); but what i want is for the node to look different so i do: // draw node content
ImNodes::Ez::InputSlots(node->m_in_slots.data(), node->m_in_slots.size());
ImNodes::Ez::OutputSlots(node->m_out_slots.data(), node->m_out_slots.size()); and there seems to be no issue with this. Is the "order important" only meant for the order of |
Order is important because Ez implementation renders node in three columns: ImNodes::Ez::InputSlots(node->InputSlots.data(), node->InputSlots.size());
ImGui::Text("Content of %s", node->Title);
ImNodes::Ez::OutputSlots(node->OutputSlots.data(), node->OutputSlots.size()); Rendering content before input and output slots will simply put them above slots. If that is what you want - it is ok to do as well. ImGui::Text("Content of %s", node->Title);
ImNodes::Ez::InputSlots(node->InputSlots.data(), node->InputSlots.size());
ImNodes::Ez::OutputSlots(node->OutputSlots.data(), node->OutputSlots.size()); |
Im doing the latter. I was just confused by the "order" as i thought that means that it is important runtime-wise. |
How can one query if the node is hovered by the mouse? Putting |
Try |
I was about to edit my comment and add that |
How are individual connection to be styled according to their state? I've added a test I've tried this but it doesnt change the style: //render connections
for (const Connection& connection : node.m_connections)
{
if (connection.out_node != &node) continue;
ImGuiStyle& imgui_style = ImGui::GetStyle();
if (connection.is_true)
ImGui::PushStyleColor(ImGuiCol_PlotLines, imgui_style.Colors[ImGuiCol_PlotLines]);
else
{
PLOGD << 1; //this prints
ImGui::PushStyleColor(ImGuiCol_PlotLines, ImVec4(1, 0, 0, 1));
}
//query removed connection
if (!ImNodes::Connection(connection.in_node, connection.in_slot,
connection.out_node, connection.out_slot))
{
Node* in_node = static_cast<Node*>(connection.in_node);
Node* out_node = static_cast<Node*>(connection.out_node);
in_node->delete_connection(connection);
out_node->delete_connection(connection);
}
ImGui::PopStyleColor(1);
} |
|
Indeed, modifying the CanvasState::Colors is what im doing right now. So far i think it's okay and no need for push/pop style, but others may want that as following the spirit and api of dear imgui |
Hi, im looking for node graph libraries that i can use for a school project. Ive been keeping an eye on this library for a while now and i have some questions which I would be really glad if someone can answer.
I think this one is easier to use than the other imnodes library.
Thank you.
The text was updated successfully, but these errors were encountered: