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

Pages: 1 [2] 3 4
16
NGUI 3 Support / Re: Problems with UISlider
« on: May 25, 2014, 10:05:26 PM »
I've just come across this issue breaking my 360 radial sliders when testing the NGui2.7 to NGui3 upgrade process.

I agree with the others. This is a major pain. Slider should not be overwriting the sprite settings.

17
NGUI 3 Support / Re: 2.7 Upgrade Guide
« on: May 22, 2014, 06:52:09 PM »
Thanks.

But to answer my original question: There is no single comprehensive guide to upgrade from 2.7?

18
NGUI 3 Support / 2.7 Upgrade Guide
« on: May 22, 2014, 09:39:18 AM »
Hi,
Is there a proper upgrade guide anywhere?

All I've found is the readme:
If you have a Standard License:
1. In Unity, File -> New Scene
2. Delete the NGUI folder from the Project View.
3. Import NGUI from the updated Unity Package.

and a video:
http://www.youtube.com/watch?v=uNSZsMnhS1o

But not very much explanation of the order of fixing things.
There's a few threads but it seems like they all have bits and tips that would be useful.

It would be useful to have it all pulled together rather than the treasure hunt it seems at the moment.
I'm testing a small upgrade atm and unsure of the order.

Opened scenes, resaved.
Dragged prefabs, resaved.

What's Upgrade Widgets on the menu do? When is it useful to apply?
All my widgets are all over the place, so scratching my head trying to figure out why and what the fix is to get them back.

Glad I tried on a small test project fir rather than the couple of big ones I need to convert!


19
NGUI 3 Support / Re: 3.6 Scroll examples
« on: May 21, 2014, 11:58:36 PM »
hmmm, neither. But a restart of unity seemed to work. Weird.

20
NGUI 3 Support / 3.6 Scroll examples
« on: May 21, 2014, 02:44:01 AM »
Hi,
Just checking out the 3.6 release on Unity 4.3.7p1 and Example 7 and 14 scroll views are not working correctly.
They scroll past the clipping and overlay other objects. Looks very messy.

Edit: Also Tutorial 6.

Unity or Ngui issue? Doesn't appear to be working correctly.

21
NGUI 3 Support / Link to 2.7 documentation
« on: October 10, 2013, 11:30:25 PM »
Hi,
Maybe I missed it?

Is there a link to the 2.7 script documentation?

Please don't remove all the 2.7 info either.
As 2.7 is the last working version before major update to 3.0 I think there will be a few projects still using it so access to documentation is still handy.

I just upgraded HarpNinja http://harpninja.com/wp/2013/10/09/harpninja-2-0-finished-development/ to 2.7 but will leave 3.0 upgrade for another time due to the amount of work necessary.

ty!

22
NGUI 3 Support / Re: UIStretch Styles...
« on: October 10, 2013, 11:14:52 PM »
I always find solutions right after posting lol. So I basically just attached the UIStretch script to the parent panel and set it to FitInternalKeepingRatio and it seems to work as desired now ^_^

How does this work?

Arenmook posted previously that UIStretch is for use on widgets?
UIStretch is meant to go on the individual widgets, and cannot be placed on the container game objects.

Your UI is going to be challenging to do with NGUI. Main reason being the whick non-tileable borders, and the interlaced (again non-tileable) background on the UI elements.

If you are really set on this kind of look, your best bet is to split it up into as many "lego-like" components as possible, or you will end up using a ton of texture memory.

I tried UIStretch on a a panel with widgets and it went crazy, everything was repositioned all over the place.

23
NGUI 3 Support / UITexture not updating
« on: October 02, 2013, 12:41:00 AM »
Hi,
I'm trying to get this color picker https://www.assetstore.unity3d.com/#/content/7353 working with NGUI but having a real pita.
I'm using NGui 2.7 for now.

I have a slider with color hues sending the update to a huebrightness material that is on a UITexture, which just has a color value.
This material is updating in the editor properly, and on the NGUI texture on initial start (it sets the right color when the OnSliderChange is sent on Start) but the UITexture will not update after that.

This is driving me nuts!

Any clues as to why this does not work properly?
It should be
. assign material to UITexture
. update material
. UITexture shows changed material

Here's the shader (one of them, the HueBrightness)

As I say this works on startup (see Start() below) but will not update on screen after that (see SetHue(hueSliderValue) ) but in the editor the background material is updating correctly.
Why does it work initially then fail to update?

  1.         public Material backgroundMaterial;
  2.     private     UITexture texture;
  3.         private Texture2D tex;
  4.  
  5.         void Start() {
  6.                
  7.                 texture = GetComponent<UITexture>();           
  8.                 //color = HSBColor.FromColor(renderer.sharedMaterial.GetColor("_Color"));
  9.                 texture.material = backgroundMaterial; 
  10.         }
  11.  
  12.     public void SetHue(float hue)
  13.     {
  14.                 texture.material.SetColor("_Color", new HSBColor(hue, 1, 1).ToColor());
  15.    }

  1. Shader "ColorPicker/ColorSaturationBrightness" {
  2.         Properties {
  3.             _Color ("Main Color", Color) = (0.75,0.15,0.56,1)
  4.         }
  5.         SubShader {
  6.             Pass {     
  7.                         CGPROGRAM
  8.                         #pragma vertex vert
  9.                         #pragma fragment frag
  10.                         #include "UnityCG.cginc"
  11.                        
  12.                         float4 _Color;
  13.                        
  14.                         // vertex input: position, UV
  15.                         struct appdata {
  16.                             float4 vertex : POSITION;
  17.                             float4 texcoord : TEXCOORD0;
  18.                         };
  19.        
  20.                         struct pos_output {
  21.                             float4 pos : SV_POSITION;
  22.                             float4 uv : TEXCOORD0;
  23.                         };
  24.                        
  25.                         pos_output vert(appdata v) {
  26.                             pos_output o;
  27.                             o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
  28.                             o.uv = float4(v.texcoord.xy, 0, 0);
  29.                             return o;
  30.                         }
  31.                        
  32.                         half4 frag(pos_output o) : COLOR {
  33.                                 half4 c = o.uv.y + (_Color - 1)*o.uv.x;
  34.                             return c;                  
  35.                         }
  36.                         ENDCG
  37.             }
  38.         }
  39. }

ty!

24
NGUI 3 Support / v2.7 bug? AddWidgetCollider
« on: September 26, 2013, 03:22:17 AM »
Hi,
I'm upgrading an existing project from V2.5.2 to V2.7 prior to V3.

Existing code on a sprite
            NGUITools.AddWidgetCollider (sprite.gameObject);
            button = (UIButton)sprite.gameObject.AddComponent ("UIButton");   

the added boxcollider was sized correctly at (1,1,0) but after V2.7 update they are all (0,0,0) and therefore don't work.

Is there something else I can do to get these back to normal?
It's quite a complex UI.

ty!

25
IS there an easier way to do this?

I need to disable some controls, but they need to still be visible and greyed out slightly.

26
NGUI 3 Support / Re: Insert images inside UILabels
« on: July 22, 2013, 08:02:10 PM »
*bump* I'm interested in this, but can't see how it's done currently? or do you use both a sprite and label?

27
NGUI 3 Support / Unity4.2 updated - fonts screwed
« on: July 22, 2013, 07:59:39 AM »
I updated to Unity4.2 and my gui textures, fonts specifically have gone spastic - lots of white space making them unreadable.
Edit: It's not just textures. See the first image to see what they look like after 4.2 update, 2nd image is before update (different scene, but same atlas Space from Starlink UI Kit)

Edit2: The textures are fine, look aok in the editor preview. It looks like the problem is the shader for the material is now screwed as it does not display correctly in the editor preview.
I'm using the NGUI standard shader of Unlit/PremultipliedColored.
What's changed in 4.2?

Edit3: Changing shader to Unlit/Transparent types puts them back to ok. Somehow Unity4.2 has screwed up the premultiplied shaders?

Release notes have this:
Texture importer now has "Alpha is Transparency" setting, which does color dilation to fix edge artifacts on semitransparent textures. It is enabled by default for GUI textures.
http://unity3d.com/unity/whats-new/unity-4.2

When the project was upgraded all the textures got reset to Texture, but now setting them back to Gui is not fixing the issue.

Anyone having similar issues or got a solution? (I'm probably missing something obvious)

ty!

28
NGUI 3 Support / Re: Long Popup List
« on: July 19, 2013, 07:20:32 AM »
I don't know why but I had to adjust the scrollbar and clipping by  - 10

  1.             //. scrollbar Background
  2.             mScrollBar.background = NGUITools.AddSprite(mScrollBar.gameObject, atlas, scrollBackgroundSprite);
  3.             mScrollBar.background.depth = NGUITools.CalculateNextDepth(mChild);
  4.             mScrollBar.background.gameObject.name = "Background";
  5.             mScrollBar.background.cachedTransform.localScale = new Vector3(10, popupHeight -10, 1);
  6.             BoxCollider bc1 = NGUITools.AddWidgetCollider(mScrollBar.background.gameObject);
  7.             bc1.center = new Vector3(bc1.center.x, -0.5f, bc1.center.z);
  8.  
  9.             //. scrollbar Foreground
  10.             mScrollBar.foreground = NGUITools.AddSprite(mScrollBar.gameObject, atlas, scrollForegroundSprite);
  11.             mScrollBar.foreground.depth = NGUITools.CalculateNextDepth(mChild);
  12.             mScrollBar.foreground.gameObject.name = "Foreground";
  13.             mScrollBar.foreground.cachedTransform.localScale = new Vector3(10, popupHeight -10, 1);
  14.             BoxCollider bc2 = NGUITools.AddWidgetCollider(mScrollBar.foreground.gameObject);
  15.             bc2.center = new Vector3(bc2.center.x, -0.5f, bc2.center.z);
  16.  
  17.             //. assign scrollbar to panel
  18.             mChildDraggablePanel.verticalScrollBar = mScrollBar;
  19.  
  20.             // setting panel's clip area
  21.             mChildPanel.clipping = UIDrawCall.Clipping.HardClip;
  22.             float clipW = x;
  23.             float clipH = popupHeight -10;// -y + bgPadding.y;
  24.             mChildPanel.clipRange = new Vector4(clipW / 2, -clipH / 2, clipW, clipH);

29
NGUI 3 Support / Re: Long Popup List
« on: July 19, 2013, 05:34:21 AM »
Hi,
Thanks for the work on this.

I'm trying it out but I'm getting clipping issues with the drop down text at the bottom, as shown in the attached image.

Any clues on how to make it clip within the border properly?

ty!

30
Other Packages / Re: UI Starter Kit: Starlink (NGUI + TNet)
« on: July 04, 2013, 08:57:56 PM »

4. Double-click the white box layer, bringing up Layer Style window.
5. Add a Stroke the same color as the box (white).


I don't quite get this.
How big a stroke in pixels?
And isn't creating a white stroke and then rasterizing it the same as just creating a white box in the first place?
Or is to to make the corners not so sharp?

ty!

Pages: 1 [2] 3 4