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

Pages: 1 2 [3] 4
NGUI 3 Support / Manual refresh of UIPanel?
« on: June 13, 2012, 05:52:20 AM »
Ok, this is a problem that can be solved in about 5 seconds in one line of code. Just trying to find that particular code.

I have a draggable UIPanel with buttons in it, as I drag back and forth everything works ok. I have a cursor in my slider which highlights a button when I click on it.

The problem I have is that when I click a new button, the graphic does not update unless I drag the panel again, even though nothing is set to static. Basically what I am looking for is something like this.


NGUI 3 Support / Bug with Typewriter
« on: June 07, 2012, 10:45:43 PM »
Fairly sure this is a bug. If you attach the TypeWriterEffect script into a UILabel it does not work when ENCODING is clicked. All the [FEFE45] etc labels pop up.

This is using a Japanese font btw. Maybe it works ok with non Unicode ones.

NGUI 3 Support / UIDraggablePanel not showing on startup.
« on: June 05, 2012, 11:00:46 PM »
Ok, so I now have my perfectly UIDraggablePanel up and working, the last problem I have to fix is that when I first startup, all the objects are positioned way off to left. When I first click in the UIDraggablePanel everything pops into view. But until I do so, the entire panel is empty. I have fiddled with all the settings and everything seems ok. The left and right colliders, the size of the UIDraggablePanel etc, but sadly nothing comes into view, and when I try to manually reposition the items, once I click run they all move offscreen again.

I created my UIPanel by dragging in the one from the tutorial and then readjusting everything to fit my window. I can only assume that is what the problem is, although I can't tell for sure. Any ideas on how to get the screen to appear correctly?

NGUI 3 Support / Most efficient search method?
« on: June 05, 2012, 06:18:01 AM »
This is probably more of a Unity question than an NGUI question, however I am curious as to how the objects are stored in NGUI and how best to traverse the child list if I am planning on doing an algorithm every frame.

Let's say I have these 2 algorithms:-


for (int i = 0; i < transform.GetChildCount(); i++)
  transform.GetChild(i).renderer.material.SetColor("_Color", new Color(1.0f, 0, 0, 1.0f));


Transform[] transform_list = myobj.GetComponentsInChildren<Transform>();

foreach (Transform the_t in transform_list)
    the_t.renderer.material.SetColor("_Color", new Color(1.0f, 0, 0, 1.0f));


Now off the top of my head I am thinking that algorithm 2 is faster because in 1, the GetChild is being called every frame (and perhaps is also being evaluated each time in the for loop as well). However algorithm 2 requires an allocation of memory for the list, so hmm, not sure which is best.

NGUI 3 Support / Non vanishing sprites in UIDraggablePanel
« on: June 03, 2012, 11:40:06 PM »
Ok, seem to be having some problems getting this to work.

I started off by dragging the contents of Example 7 into my project and then changing all the settings so it fit on my screen. Everything working as expected up till now. However when I change the horned helmets to another sprite in a different atlas, those sprites always shop up on screen.

Can't seem to figure out why, after all, all I have done is simply change the atlas on an exciting sprite.

NGUI 3 Support / Can't create 2 NGUI menus at once?
« on: May 29, 2012, 07:55:18 AM »
Whether or not this is a feature or not I don't know, but it has been bugging me for all day. I have an NGUI for my HUD which is just graphical menu. I also have a menu system, but after trying to use them both together, I can no longer use or click on any of the menus. I eventually did not create the HUD and then the menu system works! So is it true, can you only use one NGUI created menu system (in an object) at a time?

NGUI 3 Support / Starting a TweenColor event?
« on: May 28, 2012, 07:09:02 AM »
Not sure how to use this function. I have my gfx ready to apply my color tween, not exactly what the Event Receiver means. I basically just want to start().

NGUI 3 Support / Text List bug with Unicode fonts?
« on: May 28, 2012, 02:58:45 AM »
Have started today implementing a chat window but I am starting to get weird behaviour.

Even though I set my Max Height to 100, it doesn't clip it at 100 at all, it just goes on forever. Have been unable to figure it out but I believe it is down to the font used. For example when I open up "Example 12 Chat Window", if I try changing the SciFi font instead my own font. Weird things start happening, text doesn't appear etc. I guess this is down to how the font labels are being calculated right? I am using a Japanese unicode font, could this be the issue I wonder?

NGUI 3 Support / Pixel perfect pixels that don't bleed
« on: May 23, 2012, 02:59:57 AM »
Is Pixel perfect aspect ratio even possible using sprites in NGUI? I almost certain this is a Unity problem and not a NGUI one.

For example, Sprites I make in NGUI end up coming out slightly blurry, no matter what texture size or device. I made an 8x8 image and even that came out blurry, I drew diagonal lines across the image, now when I zoom in, all the pixels are blended together and instead of seeing squares I get melted looking diamond effects. I'd hoped that by having your sprites positioned in exactly the correct position away from the camera would allow the pixels to look normal but it doesn't make much difference.

I can achieve pixel perfect only by creating a sprite per square and then positioning them next to each other, but I mean come on, who would be stupid enough to have 64 seperate sprites to display a single 8x8 sprite :)

I tried clicking on every single shader Unity has to offer and I couldn't find anything to make my texture pixel perfect.

NGUI 3 Support / Sprites appearing twice in Camera view
« on: May 22, 2012, 10:54:35 PM »
Ok, not sure how to explain this, or how to fix it.

I have my NGUI Hud all working etc in the game, except that I can see it again twice rendered extremely small in the centre of the screen. I have fiddled around the camera to try and restrict the draw distance but the tiny dots in the center do not vanish, although I can get the HUD I want to see to vanish using various draw distance settings.

I think the problem lies in that I have two cameras. The main camera lies within a game already being written in Unity and I added my NGUI created HUD into it. I didn't notice it at first because I have been developing in a separate scene. If I move the HUD for example to -10000 in the X direction the HUD stays fixed on the screen but moves about 10 pixels to the left in the centre of the window.

Any ideas on what could be causing this?


NGUI 3 Support / Losing the locailisation file
« on: May 22, 2012, 02:51:43 AM »
Ok, I asked a very similiar question to this before but still haven't managed to crack it.

I have in my Hierarchy window the Asset required for my localisation text to appear.
I have it resident in my Hierachy window but when I change scenes the contents are deleted. I simply want to copy it in there if it doesn't exist.

I tried doing something similar to

Localisation_Asset = GameObject.Instantiate( GameObject.Find("MenuText_Localisation") ) as GameObject;

but it just came up with an error. Again, this feels like I am tripping up on something real simple.


Ok, I have no way I can fix this. I have managed to replicate the gameobject and I can Debug.Log it and it appears in my windows as a clone and (UnityEngine.GameObject) but it does not appear in the Hierarchy window and therefore does not work.  :'(


WTF, I deleted the line:-

"Localization.instance.enabled = true;"

and now it works?!  :o

NGUI 3 Support / Best way to edit menus?
« on: May 21, 2012, 11:28:50 PM »
Perhaps I have been doing this all wrong but I find that updating and maintaining menus to be particularly difficult.

I can't see any further than the camera in the Project Window so I have to copy a menu to the Hierarchy window, edit it from there, after editing I need to delete the asset in my Project window, drag it back in from the Hierarchy window and then delete my old asset from the Hierarchy window.

Is there a better method than this? I have to do all this to simple change one thing in a menu, many a time I have deleted the asset I have just created by mistake or mistakenly edited a menu whilst the program is still running and then lost all my progress when I clicked stop.

NGUI 3 Support / Changing a sprite in code
« on: May 17, 2012, 11:47:28 PM »
Ok, stupid question alert. How do I change a sprite into another? In code all I want to do is choose another sprite in the atlas.

Put simply, I want something like this.

MyNGUIMenu.GetComponentsInChildren<UISprite>()[0].image = "image2";

This is for a character select screen, I have my window, multiple faces in the atlas, just need to find that last piece of the puzzle to change the face.

After updating to the latest version of the NGUI I get the error:-

"Assets/NGUI/Scripts/Interaction/UIButton.cs(19,33): error CS0115: 'UIButton.OnEnable()' is marked as an override but no suitable method found to override"

Clearly something is odd, have just had a few odd looks from other people in the office since everyone has just updated their the project from the assett server and can no longer compile.

I am looking into it now.


Well I am not sure what is wrong, if I fix that error, another error appears, and another, did I do the update wrong?
I deleted all of the original NGUI stuff and then added the new update. Did I do something wrong?

NGUI 3 Support / NGUI CheckBox oddity
« on: May 17, 2012, 02:04:25 AM »
Just been fiddling around with UICheckbox. I have my checkboxes and they click and then the bool parameters updates in the function I specified.
Everything as I expect, however when I come back to the menu later, the ticks are reset back to their defaults, therefore is it was true and then I set the value to false.
Next time I go back the variable is still false but the menu is back to true. So already they have become out of sync.

Maybe I am missing something simple, such as linking a variable that makes a connection so that it reads what value the variable is and updates when the menu appears.


By the way, embarrassingly I have only just discovered that you have a front end to your website and I discovered your documentation page.
and this

I can't believe I missed it after all this time.  :o
All I have only been using is a few online tutorials. I genuinely thought the forums were your entire site, since clicking home takes you to here and there are no other links to get back to the main area. Stupid me.

Pages: 1 2 [3] 4