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

Pages: [1]
1
NGUI 3 Support / OnGUI in NGUI
« on: February 21, 2014, 08:07:04 AM »
I've noticed that there is OnGUI code inside one of the Monobehaviors supplied with NGUI. As far as i know existance of OnGUI function in runtime causes Unity3d to allocate additional memory to support their GUI solution. Is it possible in future releases to remove this code or provide a way to disable it in Release builds(via define for example)

2
NGUI 3 Support / [Suggestion] Threshold based on DPI
« on: November 29, 2013, 03:58:37 AM »
It would be great to make threshhold dependent on DPI, as ultimately we want threshold to be a circle of given radius in real world size(meters, inches whatever)

3
NGUI 3 Support / Wierd Exception in edit-time (NGUI v. 3.0.5)
« on: November 22, 2013, 08:57:29 AM »
The following exception occasionally happening to me when i'm trying to change UILabel text and/or font in edit-time(custom localization), i'm using only public UILabel API and made no changes to it

  1. MissingReferenceException: The object of type 'UILabel' has been destroyed but you are still trying to access it.
  2. Your script should either check if it is null or you should not destroy the object.
  3. UIWidget.MarkAsChanged () (at Assets/Packages/NGUI/Scripts/Internal/UIWidget.cs:531)
  4. UILabel.MarkAsChanged () (at Assets/Packages/NGUI/Scripts/UI/UILabel.cs:787)
  5. UnityEngine.Font.InvokeFontTextureRebuildCallback_Internal () (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/Graphics.cs:4543)
  6. UnityEngine.Font:RequestCharactersInTexture(String, Int32, FontStyle)
  7. NGUIText:WrapText(String, Font, Int32, FontStyle, Int32, Int32, Int32, Boolean, String&) (at Assets/Packages/NGUI/Scripts/Internal/NGUIText.cs:315)
  8. UILabel:ProcessText(Boolean) (at Assets/Packages/NGUI/Scripts/UI/UILabel.cs:832)
  9. UILabel:ProcessText() (at Assets/Packages/NGUI/Scripts/UI/UILabel.cs:794)
  10. UILabel:ProcessAndRequest() (at Assets/Packages/NGUI/Scripts/UI/UILabel.cs:310)
  11. UILabel:set_text(String) (at Assets/Packages/NGUI/Scripts/UI/UILabel.cs:231)
  12. LabelLocalization:UpdateLocalization() (at Assets/Packages/NGUI/Scripts/Localization/LabelLocalization.cs:38)
  13. LabelLocalization:OnValidate() (at Assets/Packages/NGUI/Scripts/Localization/LabelLocalization.cs:69)
  14. UnityEditor.SerializedObject:ApplyModifiedProperties()
  15. LabelLocalizationEditor:OnInspectorGUI() (at Assets/Packages/NGUI/Scripts/Localization/Editor/LabelLocalizationEditor.cs:22)
  16. UnityEditor.DockArea:OnGUI()
  17.  
Sometimes it messes up labels ( Until next update )
Any suggestions?

4
NGUI 3 Support / Depth and colliders (NGUI 3_0_0)
« on: October 15, 2013, 07:04:41 AM »
As i understand depth now works for different panels, but what about colliders?
But colliders depend on Z level for ordering.
So, is it true that now we should set both depth and Z level to get draw ordering and Input right?

5
NGUI 3 Support / The 'right' NGUI 3.x.x way to manage dynamic font sizes
« on: October 15, 2013, 05:54:18 AM »
What is the recommended way to resolve the following cituation:
two UILabels with dynamic font on it
one should be small, the other one is big

my options:
1. Create two fonts with different size - which is awful
2. Change Label scale to big and small respectevly - which is not too great either as it as i'd  like to avoid using scale for GUI

So what is considered to be the best way to do it?

6
NGUI 3 Support / Multiple widgets on one gameobject possible bug
« on: October 15, 2013, 01:56:28 AM »
Hello, I'm trying to do a button that is contained inside one gameobject.
Among other problems i've encountered an issue when trying to change gameobject position only one of the widgets actually moves(see attached images)
I think its a bug :/

Loosely related question - is it possible to set collider to automagically scale to cover whole widget?



7
NGUI 3 Support / Bug in UICamera in case of perspective camera
« on: September 13, 2013, 10:42:59 AM »
I'm currently using NGUI 2.7.0 and there is a problem with hit test for perspective UICamera
in Raycast function max ray lenght  is calculated like this^
  1. float dist = (cam.rangeDistance > 0f) ? cam.rangeDistance : currentCamera.farClipPlane - currentCamera.nearClipPlane;
But in case of perspective camera this is not correct as distance between point on near plane and corresponding point on far plane can be bigger that distance between planes( in fact it is always bigger than distance between planes except for the case of ray orthogonal to both planes )
correct value would be (if i am not mistaken)
  1. //pseudocode
  2. dist = (farPlane - nearPlane)/cos(max(fovX, fovY)/2);
  3.  

8
NGUI 3 Support / Problem in UISprite in case of tiled sprite type
« on: August 14, 2013, 06:48:48 AM »
Hello,
I have encountered a problem with UISprite.
When tiled sprite fits into UISprite more than 100 times by one of the dimentions, induvidual tiles are being scaled to 1:1 width to height ratio.
and the following warning message appears in unity log:
  1. The tiled sprite ("UI Root (2D)/MenuCamera/MainMenu/Panel/Sprite") is too small.
  2. Consider using a bigger one.
  3. UnityEngine.Debug:LogWarning(Object)
  4. UISprite:TiledFill(BetterList`1, BetterList`1, BetterList`1) (at Assets/Packages/NGUI/Scripts/UI/UISprite.cs:1073)
  5. UISprite:OnFill(BetterList`1, BetterList`1, BetterList`1) (at Assets/Packages/NGUI/Scripts/UI/UISprite.cs:535)
  6. UIWidget:UpdateGeometry(UIPanel, Boolean) (at Assets/Packages/NGUI/Scripts/Internal/UIWidget.cs:697)
  7. UIPanel:LateUpdate() (at Assets/Packages/NGUI/Scripts/UI/UIPanel.cs:1074)
  8.  

Is it a bug or intended behavior, if it is intended could you please elaborate why is it so?
UPDATE:
looked into UISprite:TiledFill
This is happening because of this condition
  1. // Safety check. Useful so Unity doesn't run out of memory if the sprites are too small.
  2. if (width < 0.01f || height < 0.01f)
  3. {
  4.         Debug.LogWarning("The tiled sprite (" + NGUITools.GetHierarchy(gameObject) + ") is too small.\nConsider using a bigger one.");
  5.         width = 0.01f;
  6.         height = 0.01f;
  7. }
  8.  
as you can see if either one of width or height is less than 0.01 both are forced to 0.01 which seems to be a mistake



Pages: [1]