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

Pages: [1] 2 3 4
1
NGUI 3 Support / Re: Dynamic Fonts Chinese Mobile
« on: April 18, 2014, 05:42:05 PM »
Just confirmed it is not my Localization system.

The Chineese text will not render on GUIText, 3d Text, or UILabels without my localization system.

2
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 ?

3
What version of NGUI are you using here, and is the UIGrid the only method of positioning you're using or do you have something anchored? UIGrid's Reposition() function should do the job if it's the only thing you have.

3.5.5

The scroll is anchored
The grid inside the scroll is not anchored
The item (sprite) is anchored to the scroll (Advanced left/right binding only)
The pictures inside the item (this is where the problem is) are anchored to the item

I am calling UIGrid.Reposition() after I add the items to the grid.

I am calling it 1 frame after the items have been added.

This is a strange bug... being that it fixes itself If I change to the scene tab or activate/deactivate the object.

4
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)?

5
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.  

6
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.

7
NGUI 3 Support / Re: NGUI 3.0.9f4 Widget Max Width
« on: January 30, 2014, 01:38:59 PM »
Thanks for your reply.

I am using a "fixed size on mobiles" root.

The problem is not fitting it for mobile screens - I optimized my views for small screens first. The problem is fitting these views on larger screens.

Imagine a "Windows Window". On mobile due to limited space you would want the thing stretched out to 100% of the screen. On desktop you would not want this. there would be too much empty space... too much space between the buttons. It is aesthetically unpleasant compared to a compact centered window.

Another example would be (reactive) webpages that shrink to smaller devices but only stretch to a point (960px).... filling the rest of the space with background (or in our place gameplay).

That said, I have come up with a fix. Its not perfect, but gets the job done without any extra code. I set the view's container widget to use a uniform anchor. I then set the anchors target's to the center. I then manually set the padding edges equal the screen size. On mobile I now have a view that fills the entire screen and on desktop I have a view in the center of the screen.

8
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.

9
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....

10
NGUI 3 Support / Re: DropDownList Loosing Focus
« on: December 10, 2013, 02:06:20 PM »
Ive rearranged all my panels to make sure the panels in the view are lower than 0 (the depth of the popup). It has not helped.

Edit : Im getting the problem in other views. This time it seems to be conflicting with a background sprite.

11
NGUI 3 Support / Re: UI Input Selection
« on: December 10, 2013, 01:55:39 PM »
I didnt like UIButtonKeys. The idea of selecting the next control for each control was tedious. Moreover mine is more robust supporting tabbing, cycling, adding / removing controls, other control types and input layers (Option Menu having input focus over the pause menu over gameplay).

Edit 1:

Ill review UIButtonKeys to see how you handle focus.... Hmm your handling focus the same as me.... My script was working last version. argh.


Edit 2:

I think I have it working. Frankly I`m not sure what I change, I just cleaned up my code. Thanks for your time regardless.

Edit 3 :

I resolved the issue. It was my own fault. I had a script that selected the dropdown on hover. It was also closing the dropdown on blur.

12
NGUI 3 Support / Re: DropDownList Loosing Focus
« on: December 10, 2013, 01:51:03 PM »
No my Event mask and Event Type are both set to UI.

13
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.

14
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

15
NGUI 3 Support / Re: Issue with Prefab'ing a 2D UI
« on: November 28, 2013, 12:02:22 AM »
Try checking the layers. Including parents. I noticed this happens when I have a container object in the default layer.

Pages: [1] 2 3 4