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

Pages: [1] 2
1
Is this something I can change on the fly? I'm making a quiz app and some questions are words and some are numbers.

2
Thank you for the info! I'm not sure where to actually execute this code though. Right now, when you tap a text box that accepts input, it automatically pops open the keyboard. Where should I add the code that specifies what type of keyboard it should be?

(Teaching myself programming is hard! Thank you for your assistance!)

3
Hi all,

I would love to be able to choose when the user clicks a text field between having the normal mobile keyboard pop up and the numeric keyboard. I know Unity has TouchScreenKeyboardType.NumberPad, but I know NGUI is using its own UIInput script.

Any help to get this working would be very appreciated!

Thanks.

4
NGUI 3 Support / Re: Moving grid into UI Root makes entries enormous
« on: March 30, 2015, 11:38:23 PM »
I've changed my code to:

  1. UIGrid tempGrid = tempLibrary.GetComponent<UIGrid>();
  2.                
  3.                 foreach (Card pickedCard in myCardCollection.cards)
  4.                 {
  5.                         GameObject go = NGUITools.AddChild(tempGrid.gameObject, tempEntry);
  6.                        
  7.                         UILabel tempEntryLabel = go.transform.FindChild("Card Label").GetComponent<UILabel>();
  8.                        
  9.                         go.transform.FindChild("Card Label").GetComponent<UILabel>().text = pickedCard.name;
  10.                         go.name = pickedCard.name;
  11.                        
  12.                        
  13.                 }
  14.                
  15.                 tempGrid.Reposition();

and I've changed the hierarchy of game objects so the panel has a child game object with the UIGrid script on it. However, it's still generating the grid entries way too large. This only started happening once I started using a Panel for the scrollview.

Would it be worthwhile to zip up the project and upload it for someone to take a look at? I'm sort of at my limit of understanding how NGUI works here.

5
NGUI 3 Support / Re: Moving grid into UI Root makes entries enormous
« on: March 25, 2015, 07:27:15 PM »
Will try that.

I've tried to scale it down in Play mode, but as soon as I grab a corner handle and try to scale the panel, it flies off into space. It's very odd

6
NGUI 3 Support / Re: Moving grid into UI Root makes entries enormous
« on: March 25, 2015, 01:24:06 PM »
I currently am. My code is:

  1. UIGrid tempGrid = tempLibrary.GetComponent<UIGrid>();
  2.        
  3.         foreach (Card pickedCard in myCardCollection.cards)
  4.         {
  5.             GameObject go = NGUITools.AddChild(tempGrid.gameObject, tempEntry);
  6.            
  7.             UILabel tempEntryLabel = go.transform.FindChild("Card Label").GetComponent<UILabel>();
  8.            
  9.             go.transform.FindChild("Card Label").GetComponent<UILabel>().text = pickedCard.name;
  10.            
  11.             tempGrid.Reposition();
  12.         }

7
NGUI 3 Support / Moving grid into UI Root makes entries enormous
« on: March 25, 2015, 01:45:21 AM »
I've been trying to get a scrollable list of trading cards working over in another thread (http://www.tasharen.com/forum/index.php?topic=12518.0). The list is generating successfully and being alphabetized successfully, but if add a UIPanel or I make the gameobject with the UIGrid component a child of the UI Root game object, when it generates the list, the entries are HUGE. Like, so large I thought they were just invisible at first, but scolling out far enough revealed they existed, but were HUUUUUUGE.

Any help would be appreciated.

8
NGUI 3 Support / Re: Create Labels in script
« on: March 24, 2015, 12:01:28 PM »
Thank you for the reply! Just to clarify, are you talking about Unity Layers? http://docs.unity3d.com/Manual/Layers.html

9
NGUI 3 Support / Re: Create Labels in script
« on: March 20, 2015, 12:59:10 AM »
I've successfully got the library creating the list and alphabetizing it. I've encountered some new problems now.

If I add a UIScrollView to the parent object (temp_library) and a UIDragScrollView to the prefab that makes up the list items, I get the following error, after which nothing spawns:

"You can't place widgets on a layer different than the UIPanel that manages them.
If you want to move widgets to a different layer, parent them to a new panel instead."

I assumed this meant the depth of the objects, but that can't be the case because I have plenty of other objects all spawning on different layers, so I don't understand this error.

10
NGUI 3 Support / Re: Create Labels in script
« on: March 20, 2015, 12:14:00 AM »
Well, I'm going to want to expand this list by allowing the user to sort by other criteria such as card cost, so id like to be able to sort the list live.

(also the solution was super simple. it's just adding the following line in the foreach loop:

  1. go.name = pickedCard.name;

I told you it had been a long time since I coded!)

11
NGUI 3 Support / Re: Create Labels in script
« on: March 19, 2015, 08:48:58 PM »
Is there a way during the AddChild code to name the child prefab? Currently I have:

  1. UIGrid tempGrid = tempLibrary.GetComponent<UIGrid>();
  2.                
  3.                 foreach (Card pickedCard in myCardCollection.cards)
  4.                 {
  5.                         GameObject go = NGUITools.AddChild(tempGrid.gameObject, tempEntry);
  6.                        
  7.                         UILabel tempEntryLabel = go.transform.FindChild("Card Label").GetComponent<UILabel>();
  8.                        
  9.                         go.transform.FindChild("Card Label").GetComponent<UILabel>().text = pickedCard.name;
  10.                        
  11.                         tempGrid.Reposition();
  12.                 }

12
NGUI 3 Support / Re: Create Labels in script
« on: March 19, 2015, 06:41:10 PM »
Ah! I didnt realize the sorting was done by prefab name instead of label string. Woops! Thank you!

13
NGUI 3 Support / Re: Create Labels in script
« on: March 19, 2015, 03:57:45 PM »
I will definitely give that a try. Will that allow the NGUI script to sort them properly?

14
NGUI 3 Support / Re: Create Labels in script
« on: March 18, 2015, 07:35:01 PM »
I'm making a list of Hearthstone cards http://www.hearthhead.com/cards

There are hundreds of them. I need to sort them alphabetically.

15
NGUI 3 Support / Re: Create Labels in script
« on: March 18, 2015, 04:14:34 PM »
Hmm, so there is no way to easily sort alphabetically without trickery? My list is hundreds of items long, and not in alphabetical order naturally (it's for a card game) so manually adding id numbers is a very very lengthy proposition which gets longer if new cards are released and numbers need to be shifted to accommodate them.

Pages: [1] 2