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

Pages: [1]
1
NGUI 3 Support / PrintedSize returns wrong size
« on: December 18, 2014, 05:26:43 AM »
Hi

I am trying to achieve a chat list with bubbles around the text, and to not just have the bubbles fit the text tightly I am using printedSize from the label. However it seems to return wrong values!

this is my code
// Message placed left
bubbleSprite.width = (int)messageLabel.printedSize.x + Mathf.Abs(bubbleSprite.leftAnchor.absolute) + 50;

I have tried to setup a picture which should illustrate the problem. The blue area is the actual size of the label rect (828), the green indicates what the value of printedSize should be (approx. 794) and the red illustrates the size returned from printedSize (638)

Is there anything I am doing wrong or a call I need to make before retrieving printedSize? (tried messageLabel.UpdateNGUIText(); but no change)

2
NGUI 3 Support / Android Button click hover problem
« on: September 24, 2014, 07:55:18 AM »
Hi

I've found a problem on Android which makes buttons go to hover state right after a button is clicked and the button is switched. To make that make sense, let me try to explain.

I have 2 prefabs, which is basically 2 different screens. The two prefabs have a button placed at the same area (top left corner). When I press the button in the first prefab it destroy's that prefab, and instatiate prefab number 2. The button placed at the same area in prefab 2 then sets it's state to "normal", but just after it sets the state to "hover" and thereby the button looks like it is hovered, even though it should not be.

Hope this makes sense.

The problem is only occouring on Android, not iOS or editor. The problem startet to occour after upgrading to 3.7.3

3
NGUI 3 Support / Wierd error in 3.7.3
« on: September 23, 2014, 08:07:30 AM »
Hi

I just found this error is present after upgrading to 3.7.3 from 3.7.1. It happens when I drag across objects with an UIEventTrigger component, which can accidentally happen a lot on mobile devices :)


Failed to call function OnDragEnd of class UIEventTrigger
Calling function OnDragEnd with no parameters but the function requires 1.
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:1065)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1768)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1402)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1474)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1221)

Failed to call function OnDragStart of class UIEventTrigger
Calling function OnDragStart with no parameters but the function requires 1.
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:1065)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1720)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1402)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1474)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1221)


Looks like the inspector for UIEventTrigger do not cater OnDragStart and OnDragEnd, maybe this is the problem??

4
NGUI 3 Support / Caret not showing at started selection
« on: September 23, 2014, 02:37:50 AM »
Hi

I have came across a minor issue, that the UIInput caret "|" is not shown at the beginning of a selection of an input field. In order for it to show you will have to press twice on the input field or write something. The problem is occouring in the editor on both multiline and single line text. On iOS it works on single line input but not multiline, where you also have to click twice or write something (yes I have modified UIInput to hide the input on multiline and password, but also tried this with the original UIInput script).

EDIT: I have hideInput enabled on all instances


 Hope you have a solution :)

5
NGUI 3 Support / UIinput, hideinput and autocorrect
« on: July 29, 2014, 05:42:45 AM »
Hi there

There seems to be a problem with auto-correct not working when input is hidden, is this a common issue, or just me? Have tested it on both iOS and Android. EDIT: I have tried using both only NGUI to test it and manually opening the keyboard, nothing seems to work. Guess it is a limitation with Unity :(

another issue that I have come across, when input is not hidden, the iOS input field is floating above the keyboard, is this something anyone have noticed? and have anyone solved it? (see attachment)

6
NGUI 3 Support / Repositioning UITable to bottom item
« on: June 26, 2014, 11:19:53 AM »
Hi there,

I'm currently building a chat system, and I want it to be so that when a chat message is received/sent it will appear in the chat, in the bottom of a list. Since each chat message might vary in length, and thereby determine the size of the widget, UIGrid is not an option since, to my knowledge, it is restricted the equal sized objects. Therefore I am using a UITable to do the job. My problem is that every time a new object is added to the list, I would like some way to scroll down the list. The table is placed under a UIScrollView, so I've been playing around adding momentum to the scrollview, but it seems to be a bad solution because it then jumps more than I want it to.

I would imagine someone have come across this issue before, and would appreciate any help or suggestions.

Best regards

7
NGUI 3 Support / Possible AlphaTween bug?
« on: June 23, 2014, 06:46:14 AM »
Hi

I possibly found a bug with the TweenAlpha script, but it also might be intentional. Anyway if I have an empty gameobject with x number of children under it, and the empty gameobject has an AlphaTween component on it, it will only fade the first object in the hierachy. It works as expected if I add a widget to the empty GameObject, but one would think it should work having a widget or not on the parent object.

- GameObject with AlphaTween
    - sprite <- (Only this will be affected by AlphaTween)
    - sprite
    - ...


8
NGUI 3 Support / What to choose, 2D sprite system or atlas system?
« on: May 28, 2014, 09:50:05 AM »
Hi there

I have been using NGUI for a while now and I do really love the atlas system. However, I've just seen the new video released showing the new GUI system, which are to be released in 4.6 and eventually in the future most of our projects might switch to that rather than using NGUI (no offense). Since the new GUI system seems to basically replicate NGUI to a great deal I was wondering whether we should start using NGUI with 2D sprites or keep the atlases that we are currently using?

I have not investigated any performance differences in using atlas vs. 2D, but is there any?

It is just a concern in order to make a smooth transaction to the new GUI system when it is released. :)

9
NGUI 3 Support / UICenterOnChild bug
« on: March 19, 2014, 11:53:52 AM »
When having a UICenterOnChild component in a scroll view, it resets when just clicking on a drag child. It works fine when just dragging around. Here is my hierarchy:

UIScrollView
- (UIGrid + UICenterOnChild)
- - (UIWidget + Collider + UIDragScrollView)
- - (UIWidget + Collider + UIDragScrollView)
- - (UIWidget + Collider + UIDragScrollView)
....

Anything I am doing wrong? I have attached the settings of the components

10
NGUI 3 Support / UIScroolView Only drag one direction if it fits
« on: March 13, 2014, 12:16:36 PM »
Hi

I am currently trying to make an app which updates content when you drag it downwards. I am using a ScrollView but cannot figure out how to go around making it behave like you see in example Facebook or twitter apps on mobile when you pull down for refreshing content. Currently it works fine when the content is larger than the scrollview, but when it it does not fit I run into problems.

The scrollview do reset itself to have content in the top when dragging down, I tried using UICenterOnChild, but that didnt work since it just fits it the the center of it, and I want the top. Secondly I tried using ResetPosition, but it just snaps right to it, and do not go about it smoothly. I also tried implementing it myself, by lerping the position of the scrollview to move towards 0, and when dragging upwards i set custom movement to vector2.zero, but this was clunky and did not work proberly.

So anyone has a solution to this? I would think it would be a nice feature to have some options like "Keep Content To Origin if fits" and maybe a "Cancel Drag in certain direction if fits". :)

The attached image shows that the scrollview just "hangs" there and do not pull back up the the content origin (the text says: "pull down to refresh" in danish)

11
NGUI 3 Support / iOS status bar
« on: February 19, 2014, 03:54:58 AM »
Hi everyone

I wonder if any of you have had any experience in dealing with the status bar on iOS. I want my application to show the status bar on iOS, but Unity (unfortunately) does not seem to reduce the rendering window size when the status bar is present, it just renders on top.

I know that for NGUI I can simply make a nested UIPanel, where I set the top anchor X pixels lower when on iOS, but this do not apply to the rendering of the non NGUI stuff.

The problem do not apply when on Android

Best
/ hrlarsen

Pages: [1]