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

Pages: [1] 2
1
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: March 17, 2014, 05:13:14 PM »
A great feature that I think would be nice I just realized that would be to have an optional button text color when the button is disabled. I have disabled sprites for my buttons but now I manually change the text color to grey  then back to white when its reenabled. Being able to have this as a option on the buttons would be sweet.

2
NGUI 3 Support / Help with Prefabs...
« on: March 17, 2014, 04:57:41 PM »
I need some advice on using panel prefabs in NGUI. I have recently went through and updated all the panels and widgets in my game to the latest NGUI and am thinking that since I have a lot of panels and that they don't always need to be on the screen or even loaded for that matter it might be a good idea to make them into prefabs that can be loaded as needed using the NGUITools.AddChild . What I'm not sure about is how to properly destroy them.

Here is my example.

Lets say I have a looting panel. When something happens in the game like player clicking on a chest or dead creature the looting panel is added to the root using the AddChild. The panel contains its script which can do all the necessary functions but the panel has a close button on it for when your done looting. What is the proper way to close this. Should the destroy function be in the script that is attached to the prefab panel or should it be elsewhere. Ill try to represent things here

UIRoot
- MainGUI Controller script attached to UIroot. Call this Script A for example purposes
- LootPrefab Panel
   - Loot panel script attached to panel. Call this Script B for example purposes.

Should the Loot panel script (script B) call the destroy on itself? if not what is the best way to handle this?

Also a second question. When using the add child it looks like you could use a resources.load.. is there any reason you would need to do this if the prefab is in your project? Perhaps thats more of a unity question??

Thanks in advance. BTW this might be a good example to do some where to show people how to properly add and delete objects using the NGUITools.functions
   

3
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: February 23, 2014, 09:50:25 PM »
There are a couple things that drive me absolutely nuts about using NGUI.

1. It seems like I can't select a bunch of widgets in the inspector then just move them with out all hell breaking loose and all of them collapsing on one of the widgets. I have ended up getting around this before by throwing a temp game object in there and putting all my labels or whatever on them and moving the object but this just seems kinda crazy to have to do this.

2. Another thing is duplicating objects. For some reason when I duplicate objects the position and scale always get messed up. Its always slightly less then the previous object. I don't seem to notice this duplicating non NGUI objects. I know that now we use the widgets size but the position is still always off by .0001 or something and my OCD kicks in and I must fix it and the scale..

3. Im not sure why but it seems like when I use it I always feel like I'm fighting it every step of the way to get it to do my bidding. The widget sizes being off on duplication, not being able to multi-select and move, going to move an object and it wants to rotate it when the move cursor icon is up and not rotate.I seem to run into a ton of these nuances. Ive learned to accept these quirks and move on but these things cause extra time required and not to mention keep me pulling my hair out.

I have to say that before making the jump to do my conversion to 3.x I took a real hard look at DF-GUI and I was pretty impressed. It seems to lacking in the overall power aspect that NGUI has but the way it works in terms of creating and laying out widgets just feels more natural to me. The inspector fields are laid out more like I'm using visual studio on a pc to create a windows app. It didn't seem to have as steep of a learning curve as NGUI either.. Granted the learning curve has come along way and thanks for the videos you have done.. Perhaps some more basic videos would be nice..

4
NGUI 3 Support / Help with Anchors and Panels and Widgets oh my...
« on: February 23, 2014, 09:36:29 PM »
Using the latest version of NGUI and have been spending the last month converting all my GUI elements up from version 2.x..

Ive noticed along the way there is a new anchoring system. I watched the video and attempted to use it but its just not making sense.

Let me elaborate.

Lets say I have a UIRoot with 3 Panels using the old UIAnchor scripts

Panel 1: Is anchored to the top and the UIAnchor script is attached to the UIPanel
Panel 2: Is anchored to the center and the UIAnchor script is attached to the UIPanel
Panel 3: Is anchored to the bottom and the UIAnchor script is attached to the UIPanel

There are of course then widgets nested under the respective UIPanel Game objects. This old sway seems to work great. What doesn't make sense to me anymore is that you can't seem to anchor the panels themselves using the new anchor system?? So it would seem you need to create an invisible type widget then nest all the objects under that. Although not knowing what your screen size will be makes creating that widget kind of a pain as you would need to stretch it? Perhaps I'm over thinking this but Im not sure if I need to now go through each and every widget with the new anchoring system and set its anchor to something else? I really don't want to do that. Id rather just set thier position on a UIPanel or some other game object the only set the panel as my UIPanel and Game objects under them objects don't get resized they just need to mostly be in the center of the screen at the size they are in the editor.

Am I over complicating this? How would a master center anchor work in the new layout system? Also is the UIAnchor script going to be phased out? Ive been going through converting all my unbutton message events over as part of this upgrade and perhaps if UIAnchor is staying I can still just use it? I don't want to be caught off base if we go through another update and have it no longer work. Id rather make these adjustments while Im going through every panel and object in all the scenes?

5
NGUI 3 Support / Re: Problem with UIText input in 3.x versions
« on: January 21, 2014, 06:31:13 PM »
Yes for instance the first time I click inside the input it selects all the text I have in there via the widget properties in the inspector, I then start typing the word say "ArenMook" , the A key will clear the field but not show up and I'm left with "renMook"


6
NGUI 3 Support / Problem with UIText input in 3.x versions
« on: January 20, 2014, 10:43:25 PM »
Hi I'm going through upgrading my project to the latest 3.x version. When converting over my input fields i noticed you now can click and highlight all the text which is nice, When you hit a key it clears the text but doesn't input the first key you pressed. So as I go to type over the selected text the input box goes from the second character on. Can this be tweaked to add the first character to make this more like a real text box?

Thanks in advance,
T.

7
NGUI 3 Support / 3.0 Upgrade Complexity Questions
« on: October 16, 2013, 07:45:47 PM »
Hi All,

I've nearly finished my current GUI with the last pre 3.0 NGUI. I have a lot of panels which have a combined total of several hundred widgets. I've been a little cautious to upgrade as i'm curious how much work will be involved.

Most of my GUI consists of panels, sprites, buttons, standard labels. I do have a handful of places that use some drag panels and a couple UISliders.

Am I looking at a difficult upgrade? I understand there is upgrade logic in place but some items like UISlider and UICheckbox need to be hooked up manually through delegates? or is there more to converting normal buttons, panels etc.. I'm excited to use the depth feature as I have to muck a lot with the current z values to tweak things just right as I have two different atlases.

Thanks in advance

8
NGUI 3 Support / Help with Colliders
« on: September 21, 2013, 08:34:18 AM »
Hi,

I have a panel on my screen that gets covered up by another panel with a dimmer sprite I use thats is stretched to take up the whole screen. The dimmer is behind the current panel. I was hoping to be able to attach a collider to the dimmer and make it so the colliders underneath it on the panel below the popup wouldn't fire. Sort of making a modal type panel. I'm not sure how to do this as the widgets under the dimmer still respond to hovers and click events. Is there a component im missing attaching here? Or is there plans to do a Modal Type panel for NGUI? If not can we add that to a future feature request??  :)

Im sure im not the only one trying to use modal panels..

Thanks in advance all!

9
NGUI 3 Support / Re: Help with uiPanel
« on: August 26, 2013, 09:09:53 AM »
SOLVED!!

Ok so I figured this out. By adding a button onto another UIPanel in my scene to just open and close the panel it was able to work. What didn't was calling the open from the other script. I was using C# messenger to call the scripts function. There must have been a problem with script order as you said even though I tried rearranging both the offending scripts and the c# messenger script within the execution order.

Thanks for the suggestions you got me pointed in the right direction. Hopefully I can start growing back some of this hair i've been pulling out.

BTW: Did you look into the object duplication issue I mentioned? Its where you add say a button widget to a panel, then highlight the root object and start hitting command d to duplicate, after about the 3rd button widget a UIPanel starts getting tacked onto each subsequent button. Not sure why even though they are all off a root UIPanel. Also for some reason the objects that get duplicated are always at a scale of 1.0008 1.0008 and 1.0008 , kind of annoying not sure if there is a way to tweak that so that are always the same as the object being duplicated.

10
NGUI 3 Support / Re: Help with uiPanel
« on: August 22, 2013, 11:27:54 AM »
In my case the enable and disable happen from the main same script. The other script is a small script that attaches to a gameobject to animate and tell it to call the Open Function in the main script.

I noticed that since installing NDATA I do have some script order UIPanel is set to 100. IS that normal for an NGUI Install?

I have attached an image of my execution order. Does this look normal for NGUI Install?


11
NGUI 3 Support / Re: Help with uiPanel
« on: August 22, 2013, 10:40:51 AM »
I was not using SetActuveRecursivley

I was just using setActive.

Should I use that on my panels instead ?

12
NGUI 3 Support / Re: Help with uiPanel
« on: August 21, 2013, 10:44:55 PM »
Still working on it. Here some things I have tried

Created a brand new panel and moved all the widgets to it. Didn't help

I've tried to comment all the code after the call to setActive on the gameobject. Didn't help.

Perhaps a better description of the setup may help.

The panel game object is connected to a public variable in the inspector.
I do this with all my panels. In the start function I set it active false to hide it.
A function from another script calls a function in the main script which enabled the panel game object and then sets things like labels etc on the widgets themselves. I'm using this method throughout and it works flawlessly.

I'm beginning to wonder if its a problem with one if the child widgets. One bug I've seen is when doing a command d to duplicate a button object. After you do this a couple times the third button object starts getting a uiPanel script attached to it as the last script. I'm not sure why this does this but I've seen it before and had to remove it.

Another thing that's kind of annoying and I'm not sure if its just a unity glitch is when duplicating the objects the scale for the duplicated object gets set to 1.008 for x y z
Not sure why but this also is kind of annoying.

Any other ideas ? Any debug scripts to could send me to try and troubleshoot??

13
NGUI 3 Support / Re: Help with uiPanel
« on: August 21, 2013, 05:42:01 PM »
OK running NGUI 2.6.4 and just updated to Unity 4.2.0f4. I tried removing the code to not disable the button and it still does it. when I click on the error it takes me to NGUITools under the SetActive.

The exact error is: Missingreferenceexception: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if its null or should not destroy the object.

I have even tried reimporting NGUI. One thing I did discover after reloading unity is I did have to change the z transform on my panels to get the text to show again on the labels. it was working fine before.

14
NGUI 3 Support / Re: Help with uiPanel
« on: August 21, 2013, 12:42:47 PM »
I'm running the latest Ngui and free version of unity. One rev back from 4.2. I'm not at home at the moment. I'll look when I get there. One thing to note is I am disabling a button on this panel through code where my other forms I have just went in and disabled the box collider.

That's the only thing I can thing if that's different.

15
NGUI 3 Support / Help with uiPanel
« on: August 20, 2013, 06:20:12 PM »
Hi. I've been using Ngui in my game pretty heavy and it's been working great.

The last panel I created is having some weird issues. When I first load the scene the panel is on I can enable and disable it all day long and it works great. If I load a different scene and come back to the previous one and try to invoke just that one panel it errors out telling me in trying to access an object that's been destroyed. This is the only panel out of many that have this issue. I'm not using any don't destroy calls in my scene.


Anyone have any ideas ?

Pages: [1] 2