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.


Topics - zippo227

Pages: [1] 2
1
NGUI 3 Support / Allow UIButton and UIInput to receive a click.
« on: September 16, 2016, 09:44:56 AM »
I have a UIButton that interacts with my custom UIInput. When the user clicks outside of the UIInput, I want to hide that UIButton, unless, the click was on the UIButton. It's pretty important for the functionality of my input. I don't want to have all the extra buttons showing unless the user currently is interacting with the input.

protected override void OnSelect(bool isSelected)
{
      base.OnSelect(isSelected);

      extraButton.SetActive(isSelected);
}

The problem is, the UIInput receives the click first, which disables the UIButton and prevents it from ever being able to receive a click. I've tried setting alpha to 0 and scale to 0, and other such tricks, but nothing seems to work. How can I implement this?

2
NGUI 3 Support / Why does UICamera hide the mouse cursor?
« on: July 03, 2015, 10:26:44 AM »
Why is there code in UICamera that arbritrarily turns on and off the mouse cursor? This resets the cursor position and makes it so that my player character cannot walk and move the mouse cursor at the same time. I've had to comment out the Cursor.visible = true and Cursor.visible = false lines in UICamera to get my game working again.

3
NGUI 3 Support / Serious issue with UIInput and tab selection
« on: June 20, 2015, 12:47:59 AM »
It appears that recently support for selectOnTab was removed from UIInput and converted into UIKeyNavigation. This did not work consistently on Password fields for me and resulted in 19 times out of 20, the ui field not being selected. My registration page goes user name, password, email; so this was really bothersome for me. Because you are secretly serializing the selectOnTab field, this was even harder for me. I don't remember setting those tabs, but this is pretty disappointing. I made an alternative script to set up how I need it since UIKeyNavigation does not work properly for Password field. Here it is for anyone who wants to manually override their navigation to support tabs. Remember that if you are having this problem, you must open your scene in a text editor and delete all instances of selectOnTab. ArenMook, I believe you should print out warnings for each time you manually add the UIKeyNavigation for users with the legacy setup.

  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. [RequireComponent( typeof(UIInput))]
  5. public class OverrideOnTab : MonoBehaviour
  6. {
  7.     public UIInput selectOnTab;
  8.     private UIInput input;
  9.  
  10.     private bool readyToSelect;
  11.  
  12.     void Awake()
  13.     {
  14.         input = GetComponent<UIInput>();
  15.     }
  16.  
  17.     void Update()
  18.     {
  19.         if (input.isSelected && Input.GetKeyUp(KeyCode.Tab))
  20.         {
  21.             StartCoroutine(SelectAfterUpdate());
  22.         }
  23.     }
  24.  
  25.     IEnumerator SelectAfterUpdate()
  26.     {
  27.         yield return new WaitForEndOfFrame();
  28.         selectOnTab.isSelected = true;
  29.     }
  30.  
  31. }

4
I have a button click that calls this function.

       
  1. public void InsertEmoji(string text)
  2.         {
  3.             Debug.Log("Inserted EMOJI");
  4.             //UIButton.current = null;
  5.             Insert(text);
  6.  
  7.             //Hack because the camera is not clearing this selection
  8.             UICamera.selectedObject = null;
  9.        
  10.             //Reselect the input
  11.             OnSelect(true);
  12.             UpdateLabel();
  13.         }

Sometimes after I click the button, I click the chat box and press enter to submit the text. This function gets called again for some odd reason. I just wanted to note this in case you might find a simple reason why it's happening. For now my fix is to manually set the UICamera.selectedObject to null as you can see in my code. That seems to fix the issue. Here is my stack trace.

Consortya.ChatInput:InsertEmoji(String) (at Assets\NGUI_Consortya\Scripts\ChatInput.cs:34)
Emoji:InsertSmile() (at Assets\NGUI_Consortya\Scripts\Emoji.cs:38)
EventDelegate:Execute() (at Assets\NGUI\Scripts\Internal\EventDelegate.cs:476)
EventDelegate:Execute(List`1) (at Assets\NGUI\Scripts\Internal\EventDelegate.cs:644)
UIButton:OnClick() (at Assets\NGUI\Scripts\Interaction\UIButton.cs:257)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets\NGUI\Scripts\UI\UICamera.cs:1079)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets\NGUI\Scripts\UI\UICamera.cs:1851)
UICamera:ProcessOthers() (at Assets\NGUI\Scripts\UI\UICamera.cs:1602)
UICamera:Update() (at Assets\NGUI\Scripts\UI\UICamera.cs:1262)

5
Is there a way for a class inheriting from UIInput to know if the user has just typed a symbol? Presently I'm having to override some of the functionality to even show a symbol.

  1.        
  2. void Awake()
  3.         {
  4.             base.Init();
  5.  
  6.             UILabel lbl = this.GetComponentInChildren<UILabel>();
  7.             lbl.supportEncoding = true;
  8.             lbl.symbolStyle = NGUIText.SymbolStyle.Colored;
  9.         }
  10.  

I've noticed that when I do type a symbole such as :smile: the input caret does not back up to just after the smile emoticon. Any ideas on how I could accomplish this? A stretch goal would be to delete the emoticon and delete the entire :smile: from the input.

If I don't hear back, then I'll just have to have the users input their symbols manually by clicking on them instead of typing them.

6
I have been thinking about this for awhile and was under the assumption that I just didn't know what I was talking about. The more I search though, the more I realize this might not exist.

I have a button on the bottom left of the screen that I want to put a tooltip on. Naturally, I would like for this button to produce a tooltip which has the anchor/pivot (whatever it needs to be) at the bottom left of itself. Then the tooltip will show up on screen. Is this something I'll need to write myself?

7
NGUI 3 Support / UIInput won't show more than a line's worth of characters
« on: September 06, 2014, 11:53:21 PM »
I've updated to 3.7.1. My input boxes no longer show me the most recent character when my input exceeds what will fit in the box. Please revert back to how it used to be. I have the size set to 0/unlimited.

8
I'm dynamically creating a label and anchoring it to an object that moves. I'm calling the UILabel.SetAnchor(myObj) function. For some objects, even if the object is standing in idle, assigning the object as the anchor causes the label to move upwards off the screen very quickly.

This didn't happen with my previous version of NGUI. I am on 3.6.0, and this has been happening for the last couple of versions.

9
I often use find references to see all the places in my code where a function is called. This doesn't work for NGUI because the list of referenced functions is not stored in a file that Mono Develop can parse through. Even if it were in a simple text file (but a more elegant solution would be preferred), it would would be extremely useful for NGUI to save the list of function delegates that it references in button clicks, slider moves, etc. Having those function calls so separated from the code and the editor requires that the developer have explicit knowledge of all the buttons in the game.

10
NGUI 3 Support / How to block OnMouseOver with UIPanel
« on: February 20, 2014, 02:04:04 AM »
Hi I have some clickable objects in my game that are not using NGUI at all. When I have an NGUI panel with a 2d box collider that covers that object, the OnMouseOver events on that object are still called. Is there a way to block that event, or do I need to have a reference to the GUI camera and poll it somehow to see if I should not respond to this event. Thank you!

11
I am on NGUI 3.0.8 f7 (latest version). If I set the UIScrollView ShowCondition to WhenDragging before I start the game (in the editor), I never see the scroll bar.

However, if I set the ShowCondition to Always before the games starts, and then change the setting during play to WhenDragging,  I see the bar during drags as expected. I'm assuming this is a small bug with the newest version.

12
NGUI 3 Support / Are any of the included dynamic fonts True Type?
« on: January 14, 2014, 12:57:29 AM »
I love that I can now select arial as a font for nearly all of my text. Are any of the other included dynamic fonts true type? I would like to use a true type font for user input to enable me to know the exact width to hold a certain number of characters. If there isn't a true type font, could one be included or recommended?

13
Hi, I appreciated your advice at Unite2013 and when you looked at a game with me and my coworker. I've just updated to the newest version of NGUI 2.6.5b.

I am using a checkbox to change settings in my own personal game. When the panel containing the checkbox is enabled, it calls that checkbox's event receiver, even though I have startsChecked set to false. The problem is that when this happens, the checkbox is now activating my toggled parameter in reverse because checking the box will now set the parameter I'm toggling to false.

I looked through the code, and it seems to me that UICheckbox's Start is in the wrong order. Start calls Set after already setting the mStarted variable to true. I think line 115 and 116 should be reversed. Otherwise, in my humble opinion, line 131 will never return true and you'll always proceed into the else if on line 137. I've modified it in my project and the checkboxes are now working as expected. I'm surprised this never bothered anyone else? :o

I've tried only listing the line numbers to keep from posting any source code to the public eye.

14
NGUI 3 Support / Labels are invisible on Mac Standalone
« on: August 21, 2013, 10:30:55 AM »
I have been building a log in scene with NGUI 2.6.3 and testing it mostly on my Windows machine, with infrequent testing on Mac. When I run the scene in my Mac Unity editor (I'm on Unity 4.2), it appears to be working correctly. I can see the labels just fine. However, when I build the game to standalone, the labels are no longer visible, but I can still see the main header label.

I did some testing where I put an arbitrary string in the (standalone-invisible) label, it was visible then on both Editor and Standalone. So, that let me know that it didn't have anything to do with the resolution of the window. But, when I try to fill them in on my own in script, they aren't visible in the standalone. Am I missing anything, or the dll doesn't work for Mac or something?

15
NGUI 3 Support / What is a Popup Menu?
« on: July 31, 2013, 04:06:39 PM »
I've been working to create a tabbed menu, and I came across "Popup Menu" I'm curious about what it does, but the documentation doesn't really explain it to me. Is it just a part of Popup List?

Pages: [1] 2