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 - MaxUylings

Pages: [1] 2
1
NGUI 3 Support / UIWrapContent scroll direction detection
« on: August 08, 2014, 05:12:42 AM »
Hello,

I'm trying to create a custom Facebook friend picker. At the moment almost everything works the way I want it to, except for one thing. I want that when you scroll down and the picker goes from "Angie" to "Bob" that there is a separator with the letter "B". This separator needs to have a different size compared to the other cells in the scrollview. This is working when you scroll down because I check when the first letter changes and at that point I change the cells settings. The problem is when I scroll back up. Because when I scroll back up the change in the first letter is between the "B" and "Angie" and because of that the cell with "Angie" gets changed. I was wondering if there is a way to check if it is scrolling up or down because if I could check that I would be able to change the settings of the "B" instead of "Angie".
Thanks for the help in advance :)

Kind Regards,
Max Uijlings

2
NGUI 3 Support / Trying to combine NGUI with FingerGestures.
« on: May 17, 2013, 07:30:41 PM »
Hey Guys,

I am not sure if I should post this here at the NGUI forum or that I should post it at FingerGestures. What I am doing is that I have a UIDragablePanel with a grid and in that grid there are 3 screens. I want it to act like the home screen of the iPhone. This I can not accomplish with the normal functionality of the UIDragablePanel. So I am trying to combine NGUI with the FingerGestures plugin. I am able to detect swipes and everything and my panel works fine but when I combine them I get all this strange behaviour. What happens is that it either jumps too far or not far enough. And then when it turns the center on child back on (as you can see in the code I turn it off for a short amount of time) it doesn't center on the middle of either objects but somewhere else I will also include a screenprint of this.

following is a code snippet of what I have right now.
  1. function OnSwipe (gesture : SwipeGesture){
  2.         var panelPosition : float;
  3.         panelPosition = panel.transform.localPosition.x;
  4.         grid.GetComponent(UICenterOnChild).enabled = false;
  5.                 if(gesture.Direction == FingerGestures.SwipeDirection.Left){
  6.                
  7.                         switch(true){
  8.                                 case ((panelPosition > -1150) && (panelPosition < 0) || panelPosition == 0) :
  9.                                 panel.transform.localPosition.x = -1150;
  10.                                 //panel.animation.Play("MovePanelAnim1");
  11.                                 yield;
  12.                                 grid.GetComponent(UICenterOnChild).enabled = true;
  13.        
  14.                                 break;
  15.                                 case((panelPosition > -2300) && (panelPosition < -1150) || panelPosition == -1150) :
  16.                                 //panel.animation.Play("MovePanelAnim2");
  17.                                 panel.transform.localPosition.x = -2300;
  18.        
  19.                                 yield ;
  20.        
  21.                                         grid.GetComponent(UICenterOnChild).enabled = true;
  22.        
  23.                                
  24.                                 break;
  25.                                
  26.                                 case (panelPosition < -2300):
  27.                                        
  28.                                         grid.GetComponent(UICenterOnChild).enabled = true;
  29.                                 break;
  30.                                
  31.                                
  32.                         }
  33.                
  34.                 }
  35.                
  36.                 if(gesture.Direction == FingerGestures.SwipeDirection.Right){
  37.                         switch(true){
  38.                                 case ((panelPosition > -2300) && (panelPosition < -1150) || panelPosition == -2300):
  39.                                         //panel.animation.Play("MovePanelAnim3");
  40.                                         panel.transform.localPosition.x = -1150;
  41.        
  42.                                 yield;
  43.                                         grid.GetComponent(UICenterOnChild).enabled = true;
  44.                                 break;
  45.                                 case ((panelPosition > -1150) && (panelPosition < 0) || panelPosition == -1150):
  46.                                         //panel.animation.Play("MovePanelAnim4");
  47.                                         panel.transform.localPosition.x = 0;
  48.        
  49.                                 yield ;
  50.                                         grid.GetComponent(UICenterOnChild).enabled = true;
  51.                                 break;
  52.                                
  53.                                 case (panelPosition == 0 || panelPosition > 0):
  54.                                         grid.GetComponent(UICenterOnChild).enabled = true;
  55.        
  56.                                 break;
  57.                         }
  58.                 }
  59.                
  60. }

As you can see in the code that is commented out I also tried using animations but without any succes. I also tried using while loops but this gave me the same behaviour.

I hope someone has a suggestion for me.

Kind Regards,
Max Uijlings

3
NGUI 3 Support / Re: inactive buttons visible
« on: November 19, 2012, 06:14:55 AM »
Oké I was just going through your documentation to look for a better solution and I found the SetActiveChildren() function. I put this on my panel object of my pause menu and this gives me the desired result :D
Thank you for your help.

Kind Regards,
Max Uijlings

4
NGUI 3 Support / Re: inactive buttons visible
« on: November 19, 2012, 06:05:31 AM »
Oké I believe I have solved the issue. What I did at first was that I tried to set the panel object to true or false. Now I changed it so that I set the children of the panel to true or false. It is not exactly what I wanted because it would have been cleaner if I could set the whole panel (parent) to true or false. But this does works the way I want. 

Kind Regards,
Max Uijlings

5
NGUI 3 Support / Re: inactive buttons visible
« on: November 19, 2012, 05:09:32 AM »
OK so I have changed what you told me to change. Unfortunately this did not change anything in the behaviour :s. It does gave me a new error message: "Destroying GameObjects immediately is not permitted during physics trigger/contact or animation event callbacks. You must use Destroy instead."

I will try to figure out what is going on and when I find out I'll let you know. In the mean time if you have any other suggestions they are more then welcome.

Kind Regards,
Max Uijlings 

6
NGUI 3 Support / Re: inactive buttons visible
« on: November 16, 2012, 11:48:59 AM »
I am really sorry, but I have no idea what you mean with setting a camera to clear color. I do not see such an option.

I have been tracing what happens and where this strange behaviour occurs. I will explain a bit more of what I am doing. I have a couple menus stored in a singleton object. A pause-menu, a finished-menu, a settings-menu. When you hit pause, the pause-menu shows up and the pause-button disappears. That is ok and functions as to be expected. When you hit "settings" in the pause-menu the settings-menu is shown. When you run out of time the lose-screen comes up. Finally, when you complete the level in time the win-menu shows up. Pretty straight forward.

The strange thing is that the behaviour explained earlier (buttons remaining visible) only occurs when you win the game. In all other scenarios everything works fine. But when you finish and I disable the pause-menu it does not disappear.

When you finish in time, so when you win, you enter a BoxCollider with a "WinScript" on it. In this script I disable the menus that I do not want shown at that moment. I was wondering if it is a problem that I do this from an OnColliderEnter function on a normal 3D gameObject.

The following example shows how I deactivate buttons when "pause" is pressed:
  1. function OnClick (){
  2.         if (trigger == PauseTrigger.enum_OnRelease){   
  3.            Time.timeScale = 0;
  4.            GameState.pauseButton.SetActive(false);
  5.        
  6.         }              
  7.                        
  8. }

the following example is what I do when you finish in time:
  1. function OnTriggerEnter(collision : Collider){
  2.         Timer.stat_timeStarted = false;
  3.         YouWon();
  4.         UnlockLevel();
  5.         SaveHighScore();
  6.        
  7.        
  8. }
  9.  
  10. function YouWon(){
  11.         Time.timeScale = 0;
  12.         GameState.finishMenuPanel.SetActive(true);
  13.         GameState.pauseMenuPanel.SetActive(false);
  14. }

I hope you can tell me what I am doing wrong. :)

Kind Regards,
Max Uijlings

7
NGUI 3 Support / Re: inactive buttons visible
« on: November 15, 2012, 03:57:49 PM »
I have updated NGUI to version 2.2.6 and restarted unity. What do you mean with setting the camera to a clear color? By the way in some scene's I have 3 camera's the normal main camera and 2 for my GUI. Is that a problem?

Kind Regards,
Max Uijlings

8
NGUI 3 Support / inactive buttons visible
« on: November 15, 2012, 10:44:06 AM »
Hello,

I have this issue that there are buttons visible that are inactive. And the weirdest thing is that when I am not in play mode I still see these buttons in the scene view but they are not even in the hierarchy. Could someone please help me? If you need other information please ask but at this moment I do not really know what information I should supply.

Kind Regards,
Max Uijlings 

9
NGUI 3 Support / Re: Draggable panel
« on: October 04, 2012, 11:07:44 AM »
Oke fair enough. that is a very good point I should have posted the code or made some screenshots. I thought I had supplied you with enough information that this was not necessary. Even though I still doubt that these vague suggestions were necessary especially because the script I was talking about is only called on two locations. But I also understand that this is probably something we are not going to agree about so lets agree to disagree. and I hope I can still ask you for advice in the future.

kind Regards,
Max Uijlings

10
NGUI 3 Support / Re: Draggable panel
« on: October 04, 2012, 06:05:17 AM »
Oke I have found out how to solve it.

I have put this code in my script where I also position the clipping rect and set the localPosition.
  1. function Awake(){
  2. GameObject.Find("Grid").GetComponent(UICenterOnChild).enabled= false;
  3. }
  4. function Start () {
  5. GameObject.Find("Grid").GetComponent(UICenterOnChild).enabled= true;
  6.  
  7. }

I do have to ask you why have you been so vague with me? You have to understand I am trying to run a commercial business here. Off course I am not asking you to solve my problems, but this was something that you clearly knew where I had to look. I was getting the feeling that I was debugging your program (which at this point I assume it is).
I am really happy with NGUI. Don't get me wrong, because I think it is a very useful tool and I will definitely keep using it and will recommend it to others. But please, I am not in high school anymore and I can't use these vague pointers about something that someone else wrote. Again, I am not asking you to write my code or solve my bugs. I am just asking to help me use your software in the best possible way. I imagine others can benefit from the way I solved this issue and how I use NGUI in my project.

Kind Regards,
Max Uijlings

 

11
NGUI 3 Support / Re: Draggable panel
« on: October 03, 2012, 11:31:49 AM »
I have tried to find out where this script is called from. But without any success. I did find out that without a UIDragablePanel it is not called. But when I go threw that script and comment out the place it looks it is called from it still is added to the panel and makes sure I cannot set the localPosition and clipping rectangle manually. Do you have any other suggestions?

Kind Regards,
Max Uylings

12
NGUI 3 Support / Re: Draggable panel
« on: October 02, 2012, 04:38:06 PM »
I tried that as well. What I found out is that it is the SpringPanel that is making this behaviour happen. But this is created during runtime and I am not quiet sure how to suppress this without breaking it. 

13
NGUI 3 Support / Re: Draggable panel
« on: October 02, 2012, 09:28:07 AM »
Oke so I managed to copy the clipping rectangle along with the local position. But now I run into the following problem. I set the local position and the clipping rectangle properties in a start function. But when I return from a lower level I do see that it starts at the right location but then it goes back to a location of 0,0,0 and the clipping rectangle also resets. Is there another place where these values are initialised and is there a way to suppress this?

Kind Regards,
Max Uijlings

14
NGUI 3 Support / Draggable panel
« on: October 01, 2012, 09:50:40 AM »
Hey guys,

I am working on a level select system and I have most of it working. There is just one problem at this point. When I go back from my levelSelect menu of world 2 to my worldSelect menu the panel is back on world 1. What I would like is that when someone for example returns from world 2 to the worldSelect menu they are looking at the button to go to world 2 again.
I tried to get the localPosition of the panel and save that to a variable in a singleton object. so when I would return to the worldSelect menu I could take that value and assign that (in a start function on the panel) to the localPosition of the panel. This did not work unfortunately. What happened was that when I now enter world 2 and return, it slides back to the world 1 button. Then, when I slide back to the world 2 button, I am not able anymore to slide back to the world 1 button.
Is there someone that knows how to solve this problem.

Thanks in advance,
Max Uijlings

15
NGUI 3 Support / Re: Scrollable menu
« on: September 26, 2012, 09:07:34 AM »
Great thanks! :)

Pages: [1] 2