Insality / druid

Powerful Defold UI component framework
https://insality.github.io/druid/modules/Druid.html
MIT License
276 stars 33 forks source link

Question about StaticGrid:remove() #248

Open NaakkaDev opened 10 months ago

NaakkaDev commented 10 months ago

Is it expected that when using the StaticGrid remove method with a shift the actual gui nodes are moved? I was confused when I used remove without gui.delete_node(deleted_node) since it visually looks like it removes the node from gui, but after I figured out how to print the node tree it looks like it just moves the grid item on top of another one.

It would be good if the documentation tells what the shift policy does more precisely. I had always assumed that it only shifts the items in the nodes array.

Btw. I like druids quite a lot, thank you for making it! :)

Insality commented 9 months ago

Hello! As I remember - yes, the StaticGrid can manage nodes position and it's related to add/remove nodes too.

By default it's shift nodes to the Left, like usual table.remove do, but you can specify shift policy to None to don't move them on remove function

Thanks for suggestion, try to figure out how to describe all of this better