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

Pages: [1] 2
1
NGUI 3 Support / Dynamic Fonts Chinese Mobile
« on: April 18, 2014, 04:05:31 PM »
I have just completed localizing my app. On the PC it works fine but on mobile (Android) the eastern fonts come up blank. I see western text where my translation failed (UI卷). I am using NGUI 3.5 and I am using Unity Dynamic fonts. I have tried custom fonts as well as the built in Ariel.

I am using my own localization system (I wanted a bunch of features NGUI's localization did not include).

Edit : Its not my localization system. Tested on 3d Text, GUIText and UILabels.

How can I troubleshoot this problem ?

2
NGUI 3 Support / ScrollView-->Grid-->Widget-->Sprite Positioning error
« on: March 24, 2014, 05:47:36 PM »
Gif of the error
http://i.imgur.com/sH4S4Bh.gif

So I have a multiplayer game lobby. When a player joins the game a new item (A widget placed inside grid inside a scroll view) is added to the listing. When this happens the portrait, rank, and lag sprites for the item are positioned incorrectly (offset to the left) on the host. It works fine for the client instance (oddly). When I tab to scene view the sprites are magically aligned correctly. When I tab back to game view the issue is gone.

I'm not sure what to do to fix this. Is there a message I can push to my child objects or the scroll view to make them snap into place (for the time being)?

3
NGUI 3 Support / Setting the Panels Offset
« on: March 17, 2014, 03:02:41 PM »
I'm working on an Infinite scroll panel. When the scroll bar attached to the scroll view reaches 100%, I load more items into the scroll panel. I noticed when I loaded the new items the scroll panel's offset and scroll bar value would reset 'to the top' (in my case the top of the panel is an offset of Y -180). No other values changed.

So, I adjusted my code to save the panels offset before new items are loaded and reapply it after the new items have been added.

  1. var offset = ScrollView.panel.clipOffset;
  2. //Add new Items Here
  3. ScrollView.ResetPosition();
  4. ScrollView.panel.clipOffset = offset;
  5.  

When I do this the panel's center value changes negating my changes. In other words, the panel's offset is -355Y (as I wanted) but due to the change in the panel's center, -355Y is equivalent to -180Y. This change in the panel's center does not occur if I leave the panel's offset alone.

How can I adjust a panels offset without altering the center value ?

Edit, Looking at the code, I think this might have something to do with my use of anchors. The scroll view is anchored to take up most of the screen (minus the header above and a scroll bar to the right). I tried using the scroll view without anchoring it's panel, but that made the scroll view 'jump around' whenever items were loaded.



Edit, I tried adjusting the panel's local position (such as in the CenterOnClick script), and I am having the same issue. The panel's center changes to negate my manual local positioning.

Edit, I have a working solution.

  1. var offset = ScrollView.panel.transform.localPosition;
  2. // Add Items Here
  3.  
  4. yield return new WaitForEndOfFrame();
  5.  
  6.  ScrollView.ResetPosition();
  7.  
  8. // firstTime prevents the scroll from centering on the first item on load
  9. if (!firstTime)
  10.   SpringPanel.Begin(ScrollView.panel.cachedGameObject, offset, 100f);
  11.  
  12.  

4
NGUI 3 Support / NGUI Panel - Disabled Anchor Bug ?
« on: January 31, 2014, 01:55:28 PM »
I have a container object which includes a panel. The panel's anchor inspector was disabled (grayed out) so I attached a widget to the object. I set the widgets size (600x400). I then added a child background sprite and set the parent as it's anchor target. The child object's anchor was 0,0,0,0 and targeted each side respectively (its a widget background). The intended behavior would be for the child object to stretch to 600x400 (the size of the parent/target) but it did not - it stretch to the full width of the screen.

Here is my hierarchy
- Root (Panel + Widget)
- - Background Sprite

I then split the parent object. I moved the widget to be a child of the panel and set the Background sprite to target the widget. This worked.

Here is my hierarchy
- Panel
- - Widget
- - - Background Sprite

So I think there might be a bug that needs to be fixed. The child anchor should grab the information from the widget script, not the panel script.

5
NGUI 3 Support / NGUI 3.0.9f4 Widget Max Width
« on: January 29, 2014, 07:06:37 PM »
I`m converting my app to use the new anchoring system. The new anchoring system seems less buggy and powerful than the previous one. That said, I can get the UI to look good on mobile or on desktop... but not both simultaneously.

Looking good on mobile is easy, given the limited screen size I can stretch my views to 100% of the visible region. However on desktop it looks ugly to stretch out the views to 100% of my screen size.

Hypothetically I think what is needed is a 'maximum size' for the widget control. Simply put the widget will stretch up to a given point (say 800 x 600). Ill look into making the control tonight or tomorrow. Any guidance on how I can achieve this with minimum effort would be appreciated.

6
NGUI 3 Support / 3.0.9f7 Anchor positioning issues
« on: January 28, 2014, 02:44:52 PM »
Using 3.0.9f7

I`m having some anchoring issues with my UI. The UI positions correctly in the editor but when I build the project many objects are incorrectly positioned.

For instance :
  • I have a button anchored to the top left. In the build it is positioned near the center of the screen. When I re-size the screen it will snap to the correct location.
  • I have several 'widgets' (a complex control with many anchors and stretch behaviors. they typically include a scroll panel with a header, title, and close button - like a window's window). They are skewed all incorrectly in the build. If I play with the build-window size they will skew to all sorts of incorrect positions (though I can get it to look correctly... sometimes.

The solution includes a pretty deep hierarchy at times... though (as with the case with the top left button) not always. I`m not sure how to remedy the situation. I can post a gif if you like. Ill go now and play with it some more.


EDIT I`m using the old layout system. I am going to start a revision of my the solution....

7
NGUI 3 Support / UI Input Selection
« on: December 09, 2013, 07:06:04 PM »
I have a custom input controller with full keyboard support (tab, left, right, ect). The scripts no longer work with the latest update (3.0.7 f1). Reading the release notes I notice that there was a change to selection (which might be related).

Quote
- DEL: OnHover is no longer sent via selection changes. Listen to OnSelect and check (UICamera.currentScheme == ControlScheme.Controller).


Here is an excerpt from my script

  1.  public void GoNext(InputChild child)
  2.         {
  3.             var ordered = Children.OrderBy(o => o.TabIndex);
  4.  
  5.             var next = ordered.FirstOrDefault(o => o.TabIndex > child.TabIndex) ?? ordered.FirstOrDefault();
  6.  
  7.             Debug.Log(next);
  8.            
  9.             UICamera.selectedObject = next == null ? null : next.gameObject;
  10.         }
  11.  

The Debug statement confirms that my code is selecting the correct next control, but the last line (where I pass it to NGUI selection) is not working. Please advise.

8
NGUI 3 Support / DropDownList Loosing Focus
« on: December 09, 2013, 06:49:28 PM »
I have a drop-down control and immediately below it is a button. When I open the drop-down list the drop-down portion overlaps with the button. It renders correctly (the drop-down portion is above the button) however when I move the mouse to select an option the drop-down looses focus (the button gains focus). How can I remedy this problem ?

I have place the drop-down in its own panel with a depth > than that of the other controls. It did nothing.

Using 3.0.7 f1

9
NGUI 3 Support / Anchors snapping out of position in scene view.
« on: November 27, 2013, 08:18:02 PM »
I have two panels, left and right. When I goto the scene view the two panels 'snap' into the center - overlapping. When I return to game view and adjust my view size the two panels snap to their correct position.

I made a gif : http://i.imgur.com/2RB719I.gif

10
NGUI 3 Support / UI Label rendering at wrong position.
« on: November 27, 2013, 02:32:29 PM »
http://i.imgur.com/phucSly.png

I have a notice widget. The widget is a grid which displays "notices" - clickable labels. The grid is anchored to the top of the screen. The notice line items have no anchoring or transforming - being positioned via their parent grid.

Many times the label renders at the center of the screen - this is incorrect. The box collider and label outline still show to be at the top of the screen... but the text is way off. In play mode my mouse hover over the correct position works (and does not work when I hover over the actual text in the wrong position.

**Edit** I was able to correct the problem by adding a panel to the line items.

** Edit2** I was wrong, it re-appeared.

11
NGUI 3 Support / Scaling UIScrollView is buggy
« on: November 26, 2013, 11:02:19 PM »
I am having rendering issues with a stretching scroll view and stretching scroll bar within a stretching container. The container fills up .9f of the screen. The scroll bar stretches vertically and is anchored to the right with a small offset. The scroll view stretches to fill the remainder of the space. Inside the scroll view I have a large 5000x high lorem ipsum text.

When I press play.. I get a number of problems.

* (Picture 1) The Container is not horizontally stretched out fully. When I readjust the screen size it corrects itself. Also the scroll view is focused on the bottom of the text.


* (Picture 2)When I adjust the screen the vertical scroll bar foreground is centered on the top of the scroll bar... but is at full height.

* When I adjust the scroll bar it corrects itself.... but If I readjust my screen size it breaks again.

* (Picture 3) Lastly regarding the  scroll view is focused on the bottom of the text. The first screen shot was with the label's anchor set to bottom and pivot set to the bottom (I was trying to fix it). This screen shot shows it with a anchor and pivot set to top. As you can see the scroll view is inverted... as I scroll down my text scrolls up.

http://imgur.com/a/3wA4B

Edit
I built a windows version of the client. The error does not appear in a published build... but If I resize the client the screen goes to shit (picture 4). Does NGUI support window re-sizing ?

12
NGUI 3 Support / Bug with UIToggleObjects
« on: November 25, 2013, 09:26:57 PM »
I have a 3 tab view using UIToggleObjects. The first toggle button has an true initial state, the other two are false. When the view awakens I see the first and second tab overlapping.

I was able to fix the issue with this hackish fix.

public void Toggle ()
   {
   bool val = UIToggle.current.value;

        // hackish fix to get my tab view to work
        if (!val && IgnoreIfFalse)
            return;

      if (enabled)
      {
         for (int i = 0; i < activate.Count; ++i)
            Set(activate, val);

         for (int i = 0; i < deactivate.Count; ++i)
            Set(deactivate, !val);
      }
   }

13
I have a simple tab view. There are 3 toggle buttons and 3 gameobject containers. When I tab back and forth that UIToggle.current is sometimes null on line 56. The issue is sporadic. If I click a tab and see an error log one time and the next time it will work !


Edit I fixed the solution. I referenced the local Toggle in awake and used that to set the value OnToggle. Does anyone else find it weird that you use a static variable to find a attached components value ?

14
NGUI 3 Support / Reflection
« on: November 14, 2013, 02:15:44 AM »
Hi I was looking at the new delegate system and noticed you have an #if section for reflection. My understanding was that reflection was always was allowed - just not Refleciton.Emit. Am I wrong in my understanding? When is reflection not allowed?

15
NGUI 3 Support / NGUI Editor Sprite Name Selection
« on: June 14, 2013, 01:50:12 PM »
I have a inventory system. Each item in the system has a monobehaviour attached where I define the item's properties and functionality. Currently one of the fields (the Icon field) is a Texture2D.

I am using the MvvM pattern. This means that my inventory item script does not draw itself and includes no UISprite's or widgets. Instead I have a second game object (the view) and use binders to set the value of the visual components (currently the icon binds to a UITexture) as defined by the inventory item.

My solution currently works fine, but I would like to define my icons using an Atlas and UISprite instead.

I noticed that in the editor for the UISprite behaviour you have a very nice Atlas and Sprite inspector. Being that manually typing in the 'name' of the sprite is a horrible solution, I would like to include this sprite selector in my inventory item script. Where is this code for this?

Pages: [1] 2