- Home /
Is there snapping for Scroll view rect?
Hi,
I need to to have my scroll view to snap on elements that is in a panel that is in it's cotainer. I've Googled and found some solutions that I could not apply to my game. But more interestingly I was wondering if there is a snapping element in Unity's new UI.
Thanks
Answer by AlwaysSunny · Jul 16, 2015 at 03:22 PM
You should absolutely being using UI. GUI is legacy except for editor scripting. I wish Unity would put this up in big bold letters somewhere so I could stop repeating it every day.
There is always a mathematical solution. I've lost familiarity with GUI stuff, but I'm fairly confident it can be done with GUI too. You'd determine the pixel or percentage intervals at which snapping would occur, measure the current position property of the component / element, round it to the nearest snap interval, then write that rounded position to the property.
Your answer
Follow this Question
Related Questions
How to hide scroll snap items, beyond borders ? 1 Answer
scrollrect jump to screen 0 Answers
Scroll Rect Snapping 0 Answers
Drag n Drop Cube To Snap In Place - Grid 1 Answer
Is there a way to check if something was snapped on a specific grid? 1 Answer