Unity-UI-Extensions / com.unity.uiextensions

https://unity-ui-extensions.github.io/
1.24k stars 132 forks source link

Radial layout group #10

Open SimonDarksideJ opened 2 years ago

SimonDarksideJ commented 2 years ago

Issue created by @SimonDarksideJ as Bitbucket Issue #​10 on 2015.03.09 18:38. Create a Layout group that lays out in a circular layout rather than just horizontally or vertically

SimonDarksideJ commented 2 years ago

On 2015.09.20 15:25, @SimonDarksideJ commented: Basic radial layout added to project.

Though I think it could do with a little improvement, such as item rotation support

SimonDarksideJ commented 2 years ago

On 2015.09.29 08:22, rahu ketulya commented: even great if it can be arranged spiral style too.

SimonDarksideJ commented 2 years ago

On 2016.11.17 15:50, Lorenzo Mureddu commented: Hi Simon, I've just found an issue in the radial layout (or at least an issue for what I'm trying to do), The parameter MinAngle,MaxAngle and StartAngle are not working as expected, if I say to them for example to be 0 min angle, 180 max angle and 0 again start angle the last element is not placed at 180 degrees but in the position where the second to last should be and so on. To fix it just change this line of code at line 61 of RadialLayout.cs FROM: float fOffsetAngle = ((MaxAngle - MinAngle)) / (transform.childCount); TO: float fOffsetAngle = ((MaxAngle - MinAngle)) / (transform.childCount-1);

BR

SimonDarksideJ commented 2 years ago

On 2016.11.17 16:09, Lorenzo Mureddu commented: Just noticed that there is a special case when the radial layout is used to have element in all the circle (Max-Min=360), in that case your solution is more suitable because it avoid to have the first and the last element collapsing each other

SimonDarksideJ commented 2 years ago

On 2016.11.17 18:09, @SimonDarksideJ commented: The original implementation used to overlap the first and last elements @lmureddu . This was fixed and now they no longer overlap. However personally I did like the effect and may re-introduce it as another option, along with @rahulG81 's idea of a spiral.

I'll look at your other suggested fix as well.

SimonDarksideJ commented 2 years ago

On 2017.01.19 19:18, SMaton commented: Hi, it would be great if there were an option to ignore inactive children. In my use case, I activate/deactivate buttons before I show the radial layout with buttons.

SimonDarksideJ commented 2 years ago

On 2017.01.19 21:27, @SimonDarksideJ commented: That sounds like a great extension to the layout. Might even add an option to Lerp when it rebalances the remaining items after removal.