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

Pages: [1] 2
1
At first it was a question.... I was just wondering if exist in how it works right now.
A lot of clients look for that behavior on ScrollView.
It would be nice to have a toggle option in the UICenterOnChild script.

Thanks!

Sorry about the post necromancy, but maybe it's useful to someone else:

Try grouping your elements inside container widgets. The Scrollview will contain the containers, and each container will work as a page.


2
NGUI 3 Support / Re: Advanced Anchors setup problem
« on: December 15, 2016, 11:57:07 AM »
That's not what's happening here, as you can see. Anyway, this answer means that this is an unknown problem and/or not trivially reproducible one.

Is it viable for you to give a hint or identifier of where in NGUI's code I can find where anchor widgets are set so I can debug the problem here?

3
NGUI 3 Support / Re: How to detect if a sprite in an atlas is used.
« on: December 15, 2016, 08:23:31 AM »
Actually, I wrote a tool to tackle this myself. Feel free to use it at your own risk.
Usage: drop the behavior on a root to all the known sprites, fill in the correct slots and use the behavior's context menu. You'll have a list of used (and how much) or unused sprites.
Remember to drag the prefabs to a root as well, or you might end up thinking that a sprite is unused because it's not on the scene, but it's in a prefab.

  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System;
  5.  
  6. [System.Serializable]
  7. public class SpriteUsage {
  8.   public string spriteName;
  9.   public int count;
  10.   public List<UISprite> sprites;
  11. }
  12.  
  13. public class CheckAtlasUsage : MonoBehaviour {
  14.   public bool m_includeInactive = true;
  15.   public UIAtlas atlas;
  16.   UISprite[] sprites;
  17.   public List<SpriteUsage> usageList;
  18.  
  19.   [ContextMenu("Clear")]
  20.   public void ClearSprites() {
  21.     usageList = new List<SpriteUsage>();
  22.   }
  23.  
  24.   [ContextMenu("Collect sprite usage")]
  25.   public void CollectSprites() {
  26.  
  27.     sprites = this.gameObject.GetComponentsInChildren<UISprite>(m_includeInactive);
  28.     SpriteUsage item;
  29.     foreach (UISpriteData sd in atlas.spriteList) {
  30.  
  31.       item = new SpriteUsage() {
  32.         spriteName = sd.name,
  33.         count = 0,
  34.         sprites = new List<UISprite>()
  35.       };
  36.       foreach (UISprite s in sprites) {
  37.  
  38.         if (s.spriteName == item.spriteName) {
  39.           item.count++;
  40.           item.sprites.Add(s);
  41.         }
  42.       }
  43.       usageList.Add(item);
  44.     }
  45.   }
  46.  
  47.   [ContextMenu("Collect only used sprites")]
  48.   public void CollectSpritesUsed() {
  49.  
  50.     sprites = this.gameObject.GetComponentsInChildren<UISprite>(m_includeInactive);
  51.     SpriteUsage item;
  52.     foreach (UISpriteData sd in atlas.spriteList) {
  53.  
  54.       item = new SpriteUsage() {
  55.         spriteName = sd.name,
  56.         count = 0,
  57.         sprites = new List<UISprite>()
  58.       };
  59.       foreach (UISprite s in sprites) {
  60.  
  61.         if (s.spriteName == item.spriteName) {
  62.           item.count++;
  63.           item.sprites.Add(s);
  64.         }
  65.       }
  66.       if (item.count > 0)
  67.         usageList.Add(item);
  68.       else
  69.         item = null;
  70.     }
  71.   }
  72.  
  73.   [ContextMenu("Collect ununsed sprites")]
  74.   public void CollectUnusedSprites() {
  75.  
  76.     sprites = this.gameObject.GetComponentsInChildren<UISprite>(m_includeInactive);
  77.     SpriteUsage item;
  78.     foreach (UISpriteData sd in atlas.spriteList) {
  79.  
  80.       item = new SpriteUsage() {spriteName = sd.name, count = 0};
  81.       foreach (UISprite s in sprites)
  82.         if (s.spriteName == item.spriteName) item.count++;
  83.       if (item.count == 0) usageList.Add (item);
  84.     }
  85.   }
  86. }
  87.  

4
NGUI 3 Support / Advanced Anchors setup problem
« on: December 14, 2016, 09:19:23 AM »
Hello

I'm having a hard time setting advanced anchors up on my widgets. It seems it's impossible to add other targets to advanced anchors, they reverting to unified anchors. It's happened multiple times. The scenario is always as follows:
  • I have a "slave" widget with unified anchors set and a "target" widget as target.
  • I change the anchors to advanced, so I have four target slots pointing to "target" in the inspector, as expected.
  • Then I drag a "new target" widget from the hierarchy to one of those slots in the inspector. Here, things break.
  • The "new target" flashes briefly in the inspector, the "target" one gets back into it and, depending on the arrangement of the widgets on the scene, "slave" dimensions get messed up.

Seemingly, parenting doesn't seem to be the cause (I've tested multiple arrangements in this sense). I've also checked if I was inadvertently creating any cyclic references, but that's not the case.

NGUI version 3.9.9 on Unity 5.3.3.

What am I missing?

5
NGUI 3 Support / Galaxy S6 touch keyboard won't work - help please!
« on: July 05, 2015, 04:31:47 PM »
Galaxy S6 touch keyboard won't work. It shows up on screen, keys react to touch, but text won't go to the UIInput.

Hide Input is on and is a requirement. I'm quite desperate right now.I'm on Unity 4.5.2 and NGUI 3.6.9. Any ideas?

Extra info: touch keyboard behavior on Android is weird on other Android devices as well. Swipe won't work, as well as text-correction or word suggestion.


6
Basically, I have a widget with other things inside it and I want to "fold" it.

Works nice, but I end up with a pile of 2px widgets instead of making then going away for that while.

7
Is there a way of setting a widget's height to less than 2 pixels?

8
NGUI 3 Support / Android touches seem misplaced
« on: March 30, 2015, 06:23:39 PM »
Has anybody noticed some colliders not working or buttons with a seemingly displaced collider on Android devices only?

I'm using NGUI 3.5.0b and Unity 4.5.

9
Labels, you say... How much text did you put in them?

If I remember correctly, I got this once by putting too much characters in a single label. I solved it by distributing it through some more labels.

10
NGUI 3 Support / UIInput accentuation not working on Android
« on: December 18, 2014, 10:34:50 AM »
Guys

UIInput accentuation won't work on Android when Hide Input is on. Auto-correction seems to be disabled on the keyboard, no matter what I put in the Input Type field, and whenever I type an accented character like ã or é I get no input, i.e. typing "pão" gets me "po".

It works perfectly in iOS devices.

I'm using NGUI 3.6.9. Any clues?

11
The only thing I change between the builds is the clipping settings. Nevermind.

12
NGUI 3 Support / Re: Emulating a portrait on PS Vita project
« on: November 19, 2014, 03:36:44 PM »
...and link all panels directly to the UIRoot, then? I should give this a try. I'll come back on this later! :-)

13
Well, what can I say? I just saw it happening. I did the tests and the sole and single culprit was Soft Clip. Constrain but Dont Clip just makes things run smooth.

I heard that mobile devices, specially Apple ones, won't deal that well with alpha clipping, but maybe there are a few things I'm missing miserably, it won't be the first time.

Any ideas?

14
The obvious one is using Soft clip as clipping, but this one usually turns an otherwise fluid framerate into a crawl on mobile devices.

So I use to go by with the great Constrain but Dont Clip option, and make sure I have UI elements and backgrounds covering the areas outside the scroll view, and this usually works well.

I just hit a situation where hiding objects that are entirely outside the scrollview would suffice and thus I can continue in the Constrain but Dont Clip Happy Land.

I guess that having a UIWidget as the base of the scrollview elements where I can set the alpha to 0 is good, but I'm having a hardtime finding out how to detect someone is entirely out of the scrollview.

Ideas?

15
NGUI 3 Support / Re: Emulating a portrait on PS Vita project
« on: November 18, 2014, 10:08:54 AM »
As every UI objects are children to both UIRoot and Camera, this has just no effect at all over the UI.

I tried to add a empty gameobject as a child to the camera and parent every UI stuff to it, then rotating this GO. Didn't work at all.

I'm started to try to get comfortable with the idea of branching the project to PS Vita and redo all the UI stuff.  :-[

Any extra ideas would be nice!

Pages: [1] 2