PistonDevelopers / mush

gui for dialogue graphs, et al.
Apache License 2.0
12 stars 2 forks source link

node container #1

Closed viperscape closed 7 years ago

viperscape commented 9 years ago

Need a generic node container/widget

Node could have:


inspiration:

stjahns commented 9 years ago

We'll want to get the basics working first, but eventually we'll also want/need to support:

stjahns commented 9 years ago

@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.

stjahns commented 9 years ago

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.

viperscape commented 9 years ago

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

viperscape commented 9 years ago

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.

bvssvni commented 9 years ago

@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.

viperscape commented 7 years ago

I'll probably reference this issue later in a future post, closing for now