InvexGames / MaterialUI

MaterialUI is a UI kit for Unity that follows Google's official material design guidelines.
http://invexgames.com/materialUI.html
Other
771 stars 200 forks source link

Snap button to text #17

Closed nah0y closed 9 years ago

nah0y commented 9 years ago

Just a suggestion,

Why don't you put something in the Update of the script, so it can check every frame (in editor only) if the text has changed, if it has, you just call the method to snap the button to text. So we don't have to press the button snap and save the scene to make things look good?

InvexGames commented 9 years ago

Well, there are times when you want to edit the text without the size of the button changing. That said, that's probably not really much of the time, so maybe I could make it automatic but give it a toggle.

InvexGames commented 9 years ago

You're gonna love what I've done with the SnapButtonToText component!

It's now much more efficient - it works out all the dimensions from one ContentSizeFitter on the Text, instead of making lots of temporary ContentSizeFitters and LayoutGroups.

It also works automatically, but only when the RectTransform size on the text has changed since the last frame. Works beautifully in both play and edit modes :D

nah0y commented 9 years ago

Yay :) Congrats!

nah0y commented 9 years ago

This is just perfect :) Way much better to use.