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

Pages: [1]
1
NGUI 3 Support / Re: Changing UITexture Material Property in 2.7
« on: April 05, 2014, 03:50:05 PM »
Just to add, that I'm already using vertex colors for something else, so that's not an option.

2
NGUI 3 Support / Re: Changing UITexture Material Property in 2.7
« on: April 05, 2014, 02:58:44 PM »
Maybe you made it free now, but it sure wasn't free when I paid for it. If you would like my invoice, just tell me where to send it.

EDIT: I emailed it to your support email address. I hope that was the correct place to send it. i was under the impression that you had asked to see my invoice before registering me on this forum in the first place, but perhaps I am mistaken.

3
NGUI 3 Support / Changing UITexture Material Property in 2.7
« on: April 05, 2014, 08:02:10 AM »
Hi,

I'm trying to change a material property of a UITexture object. I'm using NGUI 2.7, as I'm deep in a complex project.

I'm using a custom shader which has the following property :

  1. _Alpha ("Panel Alpha", Range(0,1)) = 0.1
  2.  

And this is confirmed working. Whatever value I put as the default value is the final alpha value of the shader.

I create and apply my own material to the UITexture.

  1. DynamicMaterial = GameObject.Instantiate(DynamicPortrait.material) as Material;
  2. DynamicPortrait.material = DynamicMaterial;
  3.  

I set the texture at various points because it's dynamic :

  1. DynamicPortrait.mainTexture = HT.GetTexture();
  2.  

And then finally I try to change the material property:

  1. DynamicMaterial.SetFloat("_Alpha", 1f);
  2.  

But it doesn't work.

I thought perhaps the UITexture might be creating a new material internally when I changed the main texture, so I tried :

  1. Material M = DynamicPortrait.material;
  2. M.SetFloat("_Alpha", 1f);
  3. DynamicPortrait.material = M;
  4.  

But that doesn't work either.

Could you tell me what I'm doing wrong here please? I'm not going to be able to switch to 2.7, and the custom shader is unavoidable as it does some fancy gradients.

4
NGUI 3 Support / Re: all sprites disappear when antialiasing is off
« on: March 07, 2014, 08:44:01 AM »
Is there more information I could provide which would help you determine the problem?

5
NGUI 3 Support / Re: all sprites disappear when antialiasing is off
« on: March 06, 2014, 03:32:58 PM »
Sorry for not stating it previously. All of my cameras are using forward rendering.

6
NGUI 3 Support / Re: all sprites disappear when antialiasing is off
« on: March 05, 2014, 06:23:52 PM »
Sorry for the bump, but I'm also getting all of my sprites/widgets/etc disappearing when I have antialiasing disabled. The only way I can find to fix the problem is to either force 2x multisampling in every quality mode or to disable post processing on the non-UI camera. My non-UI camera normally has the Vignetting post-processing script on it, although other PP effects may well have the same effect. Any idea why this combination of a PP effect and anti-aliasing would completely disable everything that NGUI is drawing?



7
NGUI 3 Support / Re: Create Widget Wizard unavailable
« on: December 16, 2013, 04:26:09 PM »
Thanks. I'll try modifying the shader and leaving the material alone. That should suffice, as I don't think the material has any non-default settings.

As far as I know, SetActive() does now affect children as well. The documentation for SetActiveRecursively() says that it is deprecated because SetActive() now traverses the hierarchy. I can't see any flag on SetActive to specify whether it does or doesn't. I will have to adapt my code to fit.

Thanks.

8
NGUI 3 Support / Re: Create Widget Wizard unavailable
« on: December 15, 2013, 07:02:48 PM »
As I explained above, I'm using a custom shader, and the shader works fine in 2.2.1. What's the correct way of changing the shader? I'm just changing the UITexture.material property to a material which uses my shader. If I check the inspector, while it's running, my material shows on the UITexture and my shader shows on the material, but it's not rendering correctly.


Also, since I upgraded to 2.7.0, NGUITools.SetActiveSelf() seems to be affecting children as well as the parent. Is this intended?

9
NGUI 3 Support / Re: Create Widget Wizard unavailable
« on: December 15, 2013, 02:05:45 PM »
Well it seems as though you're applying a default material and shader to UITexture's, whereas before you were happy to leave them as null if that's the way I created them. I was detecting the null material and then creating a dynamic material at runtime and applying it. Detecting the name of the default material's shader seems like a perfectly acceptable solution for now, but I can no longer render my UITexture with a transparent background. I've tried but I cannot seem to find any kind of solution for this. My shader, material, etc. are all fine because it works perfectly with earlier versions of NGUI. However, with 2.7.0, my UITexture has an opaque white background. It's almost as though it's not using my shader, even though the material assignment at runtime appears to suggest that it is.

EDIT: I found two properties which sounded relevant, but they're both read-only, so I cannot change them. The values are as follows:

PreMultipliedAlpha: False
HasDynamicMaterial: False

Are these values correct for trying to render a RenderSurface which has a transparent background? If not, how do I go about changing them?

I'm setting the UITexture->Material to my material, which already has my custom shader attached to it. It all works perfectly in old versions of NGUI.

10
NGUI 3 Support / Re: Create Widget Wizard unavailable
« on: December 13, 2013, 08:36:25 PM »
Well I've reverted to 2.2.1 and I've managed to get the Wizard showing again. Thanks for the tip on re-setting the layout. That seems to have done the trick. Perhaps it was the Window from another plugin which was interfering.

I would still like to update to a more recent version at some point - though not necessarily right now. Do you have any thoughts on major changes which happened to UITexture and UILabel->WrapText and UILabel->GetPrintedSize which I should be aware of? I don't expect you to fix bugs in code you don't have spread over numerous updates in NGUI, but if you have any thoughts on a jumping off point so I at least have an idea of where to begin or what to look into, it would be very helpful.

11
NGUI 3 Support / Re: Create Widget Wizard unavailable
« on: December 13, 2013, 05:12:59 PM »
Right, I've upgraded to 2.7.0.

There is no create widget option now, so I tried Open the Widget Wizard - which I assume is the same thing. As it did with 2.2.1, it does absolutely nothing.

Also, all of my text-wrapping is now broken. (I fixed the errors caused by the API changes, but the same values are producing completely wrong results now.)

Additionally, I have a UITexture which has a rendersurface linked to it, and renders the contents of a camera as part of my UI. That's now completely white all of the time instead of showing my rendertexture contents.

Any ideas or tips where I can begin fixing all of this? Also, some idea how I can start creating widgets again would be great.

Or am I better off ripping this all back out again and going back to 2.2.1, which at least worked. Since we now know that upgrading to 2.7.0 didn't fix the problem I was reporting, perhaps that's the best bet?

12
NGUI 3 Support / Create Widget Wizard unavailable
« on: December 12, 2013, 10:52:23 PM »
It's been a little while since I worked with NGUI but I've come back to make some UI changes and I can't create widgets. When I choose "Create a Widget" from the NGUI menu, am I not supposed to get a wizard menu pop up to choose the type and settings? When I choose "Create a Widget" nothing happens at all. I'm using Unity 4.3.1f1 and it appears to be version 2.21 of NGUI. if an update is required, is there a version pre 3.0 which will work? I am a long way into a major project and would prefer not to break everything at this stage.

13
NGUI 3 Support / Apostrophes in Labels
« on: May 10, 2013, 08:41:12 PM »
Hi,

For some reason, I don't get apostrophes in my UILabels when I set them programatically. If I enter the text manually in the editor, it seems to be working, so the font is clearly correct. I assume that this is a text encoding issue. The actual label text is a string which is built from string literals and a chunk of text from a Spaghetti Machine graph, and I set the UILabel.text property. Do I need to do some kind of encoding in order to make this work correctly?

EDIT: I just tested string literals alone and that works fine too. So I presume it's something from the text I'm getting from the Spaghetti Machine graph, but not sure what encoding you need or how I would go about it. Perhaps if you can tell me what it should end up as and the SM developer can tell me what it's starting as, I can fill in the gaps.


Regards

Phil

14
NGUI 3 Support / !IsFinite errors thrown by Editor
« on: October 04, 2012, 01:18:49 PM »
I'm getting a lot of Unity Editor errors thrown whenever I try to work with one of your sliced sprites. The sliced sprite in question is 1720 x 250 - more or less. The vertical scale goes up a bit more sometimes, but it's in that region. When I use a simple tween script to adjust the scale of the object to make it appear and disappear, I get these errors thrown:

!IsFinite(outDistanceForSort)
!IsFinite(outDistanceAlongView)

They are repeated a number of times, but those are the only two different errors.

I'm guessing that something in your editor scripts is trying to calculate something and ends up with a NAN, thus throwing the Editor error.

I've searched the forum and didn't find much. I found two threads which said Unity doesn't like the very large scales that NGUI encourages us to use. So I cut my virtual resolution down by 1/4, but the errors are still there. I also found some references suggesting that NGUI doesn't like negative scales, but I don't have anything scaled to a negative number, so I don't think that's it.

Pages: [1]