Vide creating UI for Multiple entities
so i am using Vide, Charm and Matter in my project, and I would like to have one root for all the UI. The issue is i am not sure how to do that, currently when an enemy is added i call a function
to add the info i need for a certain UI and when the enemies readonly map is updated it would be handled by a vide
<For></For>
but that can get messy really quickly as soon as i want to create more UIs for the enemies or need to pass more info, since i would just have a duplicate object of the enemy entity, so i am not sure how i could create UI that's not gonna stay for long, like be destroyed after a while, i will need to do that also with towers entities, i don't want to keep creating functions to add certain UI then another function to destroy these UIs, is there a better way to do that ?9 Replies
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
i did have it like that, but for someone reason it didn't update when something was added to the enemies array (actually it's a map, gotta rename it) making it into a function seems to have made it work
also do you think there is a way to make it get the components of the newly created entity without me having to pass them all to a function which will just re-add them to a new map ? if i just pass the components of the entity to the function to put them into the map that would mean i am having 2 different containers (one of them is the matter world and the other is the Map atom that the UI relies on) and i think some stupid things can happen if i use that approach in the long term
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
wait lemme try it again
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
oh yeah i think i did make that mistake, it's working now
just an object of data
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
i will look into that, maybe i could find a better way
also thanks for helping me with the creation of UI