Closed viperscape closed 7 years ago
We'll want to get the basics working first, but eventually we'll also want/need to support:
NodeOuput<T>
or a NodeInput<T>
from another node, where T could be an f32
, or an AnimationPose
, etc)@viperscape - I'm done working on the Node widget for the day if you want to take over, doesn't look like Conrod widgets will mix with our Node widget, but that's not a huge problem yet.
To make the Node draggable, we'll have to have some kind of 'react' or 'on_drag' callback to adjust the position, which could probably be stored in the petgraph node state. Not sure about the best way to handle it yet myself.
for draggable, I was considering a well placed button to act as a drag bar (or even the entire background of the node as this but I'm not sure on conrod and layering widgets). I was planning on just using the react callback if possible, and setting the node position to the mouse coordinates (we could track mouse coordinates every frame regardless). I'll see if I can work up an example soon
On closer look I think storing position in graph makes sense, as we can easily serialize this state. I'm still wrapping my head around conrod, for instance how could one widget affect another. To get collapse state I realized it may be best to use toggle widget since it's built for it. The way I see it, a container with multiple widgets is appropriate, such as remove, drag, collapse; but I'm still not sure how a widget can affect another widget. Maybe it makes more sense to use a global state for the container, that sub widgets look at during updates.
@viperscape In Conrod you affect other widgets by changing the data that is used to create the widget. This is because the widgets are separated from its state and created every frame. The container widget should receive the graph data and recreate the sub widgets in the same way one would write it in application code.
I'll probably reference this issue later in a future post, closing for now
Need a generic node container/widget
Node could have:
inspiration: