ImNodes
ImNodes copied to clipboard
Add picture inside of the node
Hi, first of all I want to thank the developers for efforts and spent time for lib dev!
Is it possible to add picture to the node background and custom setup the pins distance and positions inside of the node?
If not, is there any plans in future to add this feature?
Thank you!
You could set node background to a transparent color and render image background using ImGui::Image(), explicitly positioning it before drawing. Node positions are hardcoded and you would have to modify EndSlot() in ImNodes.cpp to change that. No plans to implement position customization for now.
You could set node background to a transparent color and render image background using
ImGui::Image(), explicitly positioning it before drawing. Node positions are hardcoded and you would have to modifyEndSlot()inImNodes.cppto change that. No plans to implement position customization for now.
Thank you very much for a quick reply! I am really new with your library and imgui., may I ask you to show me a brief code example of how to set the node background to transparent color and how to use ImGui::Image () to explicitly position and add image to the node background? Also is it possible not to show the node borders and title because I need only the image and pins connected to it?
Thank you!!! I will take a look on the EndSlot().
Colors are set in CanvasState::Colors array, use StyleColor for array indexing. Item position is set with ImGui::SetCursorPosition().