-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Notice how nodes X, D, and E are centered perfectly but node B is not quite "centered". Rather B is leaning more towards nodes E, F, C instead of nodes W, D. This is because of how the parent node center is calculated. The sum of the y positions are added together and divided by the number of nodes giving the "averaged weighted center".
This could be the way to represent the tech tree nodes however I would like to see how it looks if every parents center was calculated based on the top child node + the bottom child node y position divided by 2 to get the "true" center.
Perhaps a boolean could be added to switch between the 2 styles to see which ever looks better.
client-godot/Scripts/UI/UITechTreeResearch.cs
Lines 231 to 236 in 7bd69f2
// Find weighted middle y pos based off children | |
for (int i = 0; i < data.Unlocks.Length; i++) | |
{ | |
yPos += ResearchData[data.Unlocks[i]].Position.y; | |
} | |
yPos /= data.Unlocks.Length; |