Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stepnoy

Pages: [1]
1
Use the SetState function.

We should use SetState for each UIButton?

2
NGUI 3 Support / UIButton bug with multiple tween targets in disabled state
« on: November 24, 2014, 11:46:08 AM »
Hello,

We had found a bug. When button becomes disabled we need to change a sprite and an inner label color as well. So we was added a second UIButton component to the button object. We have a correct behavior when button state changes for all states except disabled state. Label doesn't want to change it's color.

Hierarchy
-Button object (Collider, Sprite, UIButton (Tween target = Button object), UIButton (Tween target = Label))
--Label

So we had found a workaround to make this work, but it doesn't seems like a true solution. As far as I can see bug is connected with some code inside "isEnabled" property. When the first UIButton isEnabled becomes false it disables shared collider,  then the second UIButton already have isEnabled in false (because of disabled collider) so it doesn't do anything to change it's color.

We are using this code to make it work.

  1.     void SetButtonState(GameObject button, bool state) {
  2.         var components = button.GetComponents<UIButton> ();
  3.  
  4.         foreach (var c in components) {
  5.             //
  6.             // Ничему не удивляемся - так надо :)
  7.             c.isEnabled = !state;
  8.             c.isEnabled = state;
  9.         }
  10.     }
  11.  

3
NGUI 3 Support / Re: Widget with fixed max size
« on: October 21, 2014, 03:15:01 PM »
For something like that you will need to write custom code. NGUI's layout system doesn't have any checks for whether something fits or not.

Can you please give me a directions where I had to make changes in code ?
Is it will be enough to just adding a new component to widget that in Update function will check a bounds of widget and correct it if necessary ? My widget is anchored to right side and center of container.

About my case. I have a right-side tool panel that is initially designed for 4:3 aspect ratio. I need to make sure that it will in will scale automatically all aspect ratios except an 16:9 one, when it must be a bit narrower that it does when scaling automatically.

Pages: [1]