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

Pages: 1 2 [3] 4 5 ... 17
NGUI 3 Support / How do you stretch an UISlider?
« on: June 21, 2013, 01:05:21 AM »
Hello, not quite sure why I am problems with this. Must be doing something wrong.

Ok, I have an energy bar using UISlider that has a length of about 200 pixels.

I want the energy to increase in length, for example to 300 pixels. But the UIValue "Value" slider from 0-1 is locked to 0-200.

I can modify the background image to stretch it to 300 but can't do it with the foreground image.

NGUI 3 Support / Re: Font Maker corrupts atlas
« on: May 01, 2013, 06:13:42 AM »
We get this issue in Windows7 when changing fonts too in NGUI, but only with large atlases.
I believe the problem is Unity related and not a fault of NGUI. When you have a lot of assets moving around or just a lot in the scene in general, behaviour in Unity can be erratic. The same issue happens here when someone commits a lot of resources at once. When you do that Unity needs to re-import them, and doing so it will often crash half way through and screw up other stuff, unless you reboot Unity, sometimes it crashes 2 or 3 times and gfx get corrupted before it finally finishes.

My crappy advice would be to restart your computer and then make your font changes on a fresh boot, chances are you're likely to have lots of memory remaining not chomped away by constant usage Unity and it probably won't crash.
Or edit your fonts in a completely empty scene.

I wonder if Unity 4 is any different. We are still using the final build of Unity3.

Haha, I am an idiot. It's just that you don't know me well enough yet.  ;)

Besides, after I made the previous post, I looked in the FAQ and found the solution to the issue that you posted. in February! So it was already there after all, albeit right at the bottom.

I did do a search and up popped this topic. The "why now at this late stage" error has probably been confusing a lot of people like me late into their development.

If it has indeed been asked and answered a hundred times now, perhaps you should make a sticky about it and what the issue means, to prevent idiots like me asking stupid questions.

This error popped up suddenly for me too. Thanks to the advice on this thread it was a simple fix, but this error didn't happen before. Is something really bad going to happen if I leave my stuff at 0.0f and not 0.01f?

NGUI 3 Support / Re: UIInput, deleting buffer?
« on: November 28, 2012, 10:47:41 PM »
Hmm, well after a bit thought. I don't think this is possible.

For example, when the iPhone keyboard pops up, it already has its string present from before. So whether you clear it or not, the api from the external keyboard, there is surely no way NGUI or Unity can get at that information.

NGUI 3 Support / UIInput, deleting buffer?
« on: November 28, 2012, 09:33:19 PM »
This is probably an easy one but I can't seem to figure it out.

I use UIInput to enter a string, such as "Hello". I press enter, and the string is saved to my UILabel.
However when I open UIInput again, the prompt is blank, but as soon as I type "Hello" appears again in the display box.

How do I delete this?

I've setting a blank string to both the .text of the UILabel I'm passing the string too and also the .text of UIInput.
But no luck.

NGUI 3 Support / Re: Sending Parameters within Buttons?
« on: November 22, 2012, 12:36:12 AM »
Thanks a lot for all your help and advice JRoch.

I was tempted to just hack UIButtonMessage but I think I will rethink my approach a little. Or just stick with my kludge for now.

Thanks again :)

NGUI 3 Support / Re: Sending Parameters within Buttons?
« on: November 21, 2012, 11:35:25 PM »
Ok, let's simply say I have a simple e-mail list flick Panel.

I create a button "Read Message" and one UILabel.

I get from the server a number, it says for example 4, I have 4 e-mails. So I clone the collecting of one button and one uilabel 4 times.

Now I have cloned the objects 4 times, they are repositioned in the panel and scrolling works. Ok so far?

All the "Read Message" buttons are the same and point to the same function.
Let's say

"void GetEMailMessage()"

Unfortunately my function to get that e-mail message requires a pointer and my function is.

"void GetEMailMessage(int pointer)"

But none of the buttons are able to pass a parameter to this function, just call it.

To get around this I renamed each of the cloned objects to a number. It looks something like this.

0 - MyUILabel

1 - MyUILabel

2 - MyUILabel

3 - MyUILabel

All my buttons point to "void GetEMailMessage()"

So I grab the name of the object and int.TryParse it and then pass that into a different function.

My question is, is there a better way of doing this?

I hope this explanation makes sense :)

NGUI 3 Support / Re: Sending Parameters within Buttons?
« on: November 21, 2012, 11:11:08 PM »
Well judging from UIButtonMessage. I can't seem to find any other way of using NGUI to get messages to be sent to places other than just a function name.

The flick menu in question gets data from a server, it might be an e-mail message or a user profile. But whether it is either of those things, you are going to want to have some variables passing into a function.

All I can see at the moment is sending a message to a function without being able to pass in any variables. I might want an int, or a string so I can access a dictionary etc.

The best I can describe it as before, where I rename the function name to MyFunction1, MyFunction2 etc and have them all point to a MyFunction(int num)

NGUI 3 Support / Re: Sending Parameters within Buttons?
« on: November 21, 2012, 10:46:39 PM »
Thanks for the post JRoch.

Yes that is what I am trying to do. This OnClick() I guess is something I write then and then attach as a separate script to each button?

Up till now I have been sending all my UIButtonMessages to the main source in each menu.

In a nut shell what you have described is what I am trying to do. However with this method, I would still have to create an instance of my menu object so I could send it there, or send another message.

What I am trying to do basically is to send a single message to OnClick but with args.

OnClick(int myint)


--- UIButtonMessage(Script)
Include Children

NGUI 3 Support / Sending Parameters within Buttons?
« on: November 21, 2012, 10:08:34 PM »
This has been bugging me for ages, seems like a really easy thing to do but yet without fiddly work arounds I can't seem to cleanly get this to work.

Anyway, my example.

Let's say I have a flick panel full of buttons, I duplicate lots of buttons from the 1st entry, but each button has OnClickButton. So each button points to the same function in code.
What I want is something like "OnClickButton(1)", "OnClickButton(2)" etc. But it seems you can only point to a function but not pass it any parameters.
So unless I have something like:-

void OnClickButton(int p)

void OnClickButton1()

void OnClickButton2()

void OnClickButton3()

... etc
I can't get which button was clicked in the flick panel.
Any ideas on how I could do this effectively?

ArenMook, I looked in many of your threads. Such as this one

and I am completely lost.

In the end I got around the 'issue' by renaming my Button objects to simply numbers and then grabbing the Unity GameObject object name using and then converting the string to an int.

NGUI 3 Support / Re: Interesting year...
« on: October 30, 2012, 04:29:53 AM »
This is really awesome news, well done!

Unity4's UI system optimised by you is a worthy reason in itself to upgrade to Unity 4.
Awesome news for an awesome guy, you deserve all the credit for all the hard work you have put into everything.

NGUI 3 Support / Re: Font not showing *only* in iOS build
« on: October 02, 2012, 10:48:05 PM »
I am not sure what Unity does, but when Z objects are the same, the drawing order seems to be platform specific rather being random.

I had a button that once pressed, spawned several other buttons which popped out from behind the main button, but on the Mac, iPhone etc they always appeared on top of the main button. The issue being both sprites had the same Z.

However the issue seems to be made more complex when you have multiple Atlases. You're probably (and quite rightly) using an Atlas for your font and another for your menu gfx. Problem is, staggering two buttons over each other will result in the text appearing over both buttons, even if the Z position and DrawingOrder is correct.
All it takes for example is one label to be really far away from your camera to make all your text vanish behind your gfx. Which can and often will be ok in Windows but not on iOS or vice versa.
Unless you use a separate UIPanel to make an extra DrawCall.

For now, my advice is that you double check your menus on your target platform every now and again to make sure you don't have any weird vanishing graphics issues. If like me you tend to copy and paste your widgets around, it can be a pain to sort out all your Z issues later.

I agree on this, The Drag and Drop example is pretty complicated in comparison to the other samples.

A simple drag and drop any item onto a slot without all the RPG slot elements and different slot functionality elements removed.

A drag and drop sample between two draggable panels would also be awesome.

Pages: 1 2 [3] 4 5 ... 17