Skip to content
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

Add picture inside of the node #34

Open
aabilityuk opened this issue Jul 26, 2021 · 3 comments
Open

Add picture inside of the node #34

aabilityuk opened this issue Jul 26, 2021 · 3 comments

Comments

@aabilityuk
Copy link

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!

@rokups
Copy link
Owner

rokups commented Jul 26, 2021

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.

@aabilityuk
Copy link
Author

aabilityuk commented Jul 26, 2021

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.

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().

@rokups
Copy link
Owner

rokups commented Jul 26, 2021

Colors are set in CanvasState::Colors array, use StyleColor for array indexing. Item position is set with ImGui::SetCursorPosition().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants