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

Pages: [1] 2 3 ... 10
1
NGUI 3 Support / Re: Follow UISpite type: Filled
« on: January 30, 2015, 09:22:33 AM »
I'm not sure, but I think, you must calculate your dynamic distance (radius) based on image pixels count for current angle.

2
NGUI 3 Support / Re: Follow UISpite type: Filled
« on: January 30, 2015, 03:53:09 AM »
Hi!

You can try something like this:

  1. public class Test : MonoBehaviour
  2. {
  3.     public UISprite FilledSprite;
  4.     public UISprite MarkSprite;
  5.  
  6.     private float _radius;
  7.  
  8.     void Start()
  9.     {
  10.         _radius = FilledSprite.width / 2f;
  11.     }
  12.  
  13.     void Update()
  14.     {
  15.         var amount = 1 - FilledSprite.fillAmount;
  16.         var angle = 360 * amount;
  17.  
  18.         var radAngle = angle * Mathf.Deg2Rad;
  19.  
  20.         MarkSprite.transform.localPosition = new Vector3(
  21.             Mathf.Sin(radAngle) * _radius,
  22.             Mathf.Cos(radAngle) * _radius,
  23.             0f);
  24.     }
  25. }
  26.  

3
NGUI 3 Support / Re: UICamera for 2D events (Colliders order)
« on: December 10, 2014, 01:53:05 AM »
OnMouseDown is a Unity event, not an NGUI event.

Yes, I know, I just checked OnMouseDown behavior too.

NGUI's equivalent is OnHover (bool isOver).

I think you mean OnPress(isDown = true) is equivalent for OnMouseDown, no?

World type events are not based on NGUI's depth. If you set the event type to UI, then it will be depth-based. World type means it's based on the Z position.

Yes, thanks, with 2D world and Z position all works fine.

4
NGUI 3 Support / Re: UICamera for 2D events (Colliders order)
« on: December 08, 2014, 02:51:45 AM »
  1. void OnMouseDown()
  2. {
  3.     Debug.LogWarning("OnMouseDown " + name);
  4. }
  5.  

OnMouseDown also detect wrong collider order. I think I do something wrong. Setting sorting layer and order in layer doesn't help.

All works fine if I used Box Collider with custom Z order, instead Box Collider 2D and 3D World event type for UICamera.

But how to make that work properly with the Box Collider 2D and 2D World event type?

5
NGUI 3 Support / UICamera for 2D events (Colliders order)
« on: December 08, 2014, 02:29:15 AM »
Hi!

I create 2D game with game levels map like in "candy crush saga".

Unity 4.5.5, NGUI 3.7.6, 3.7.7

UICamera event type 2D World.

But I do not quite understand how to determined the order of events for the colliders.

I have structure:

- Game Map (Box Collider 2D with size = Sum of Tiles colliders bounds, disabled now)
- - Map Camera (Ortho camera and UICamera)
- - Tiles
- - - Tile 1 (Sprite Renderer with Sorting Layer = Default + 1, Box Collider 2D)
- - - - Levels
- - - - - Level 1 (Sprite Renderer with Sorting Layer = Default + 2, Box Collider 2D)
- - - - - ....
.... (N Tiles with N Levels)

For test, I added next script for each game object (Game Map, Game Time, Game Level) and checked Debug Mode for UICamera:
  1. void OnClick()
  2. {
  3.     Debug.LogWarning("OnClick " + name);
  4. }
  5.  

Sometimes shows wrong object (see attach images). For example, I clicked on Game Level object, but Debug shows like I clicked on Game Tile.
Every time when I run project, Debug shows different events order for game objects. Looks like colliders order is different.

In attach: screenshots and simplified repro project.

Thanks!

6
NGUI 3 Support / Re: Setup of Unity Camera & NGUI camera
« on: November 05, 2014, 09:22:51 AM »
Start a new scene, and add a sprite (ALT+SHIFT+S). Note that although you have a main camera and a newly added UI camera, there is only 1 draw call present. This is because the main camera doesn't draw anything (there is nothing visible).

So all I can tell you is -- check what's drawn by your main camera.

If checkbox "Use Direct3D 11" in Player settings is unchecked, then yes, empty scene with default NGUI 2D UI (without any widgets) has 0 draw calls.
But if "Use Direct3D 11" is checked, drawcalls count equals 2 (1 for main camera and 1 for UI camera).
It is normal?

7
NGUI 3 Support / SlicedSprite border offset and Direct3D
« on: November 04, 2014, 06:44:03 AM »
Hi!

I switched back from DFGUI to NGUI and I have a question.

Unity 4.5.5f1, NGUI 3.7.5

I create simple SlicedSprite and looks like the sprite has border offset (attachments). "Use Direct3D 11" settings is disabled.
If I enable "Use Direct3D 11" checkbox in Player Settings, sprite border becomes ok.

If I'm not mistaken a year ago this was not. It is normal behaviour?

The only thing similar that I found to the forum:
http://www.tasharen.com/forum/index.php?topic=9253.msg44510#msg44510

Thanks!

8
NGUI 3 Support / Re: Virtual Layout for ScrollPanel
« on: July 07, 2014, 05:13:44 AM »
Ok! Thanks!
I hope it works fine with scrollbars and without items recycling (i.e. 0...9 instead 0-1...9-0-1...)

9
NGUI 3 Support / Virtual Layout for ScrollPanel
« on: July 07, 2014, 12:58:27 AM »
Hi!
Long time since I was not here :)
it would be great if ngui would have a VirtualLayout functional:
https://www.youtube.com/watch?v=cMk7ZR_mw8E
Useful for ScrollPanel with lot of items.
How do you think?

10
NGUI 3 Support / Re: (!!!) Improving NGUI: Voice your opinion
« on: November 13, 2013, 09:13:53 AM »
With regards to opportunities, we would like to see a lot of that is in the Flex in Flash (eg layout system) :)

11
NGUI 3 Support / Re: Draggable Panel content blurring
« on: November 08, 2013, 06:03:13 AM »
Not seeing it on my end.

You probably have not noticed, although in the video that I post is clearly visible. This is repeated each time (web build, not editor). If I'm not mistaken it only happens once. Refresh panel doesnt help.

12
NGUI 3 Support / Re: Draggable Panel content blurring
« on: November 07, 2013, 09:48:07 AM »
Got it, found the issue with the blur, will fix.

Ufff, I really thought it was me doing something wrong :o
What about the second question about the tabs (Clipped Panels)?

13
NGUI 3 Support / Re: Draggable Panel content blurring
« on: November 07, 2013, 08:00:47 AM »
Here, I've done all over again. Changed your example. You can not always see it, but quite often.
How correct save scene without NGUI code?
Attach a scene and the script, without NGUI code directory.
You can also reproduce the problem which I have written in this topic. http://www.tasharen.com/forum/index.php?topic=6536.0
But this is only visible in the build.

14
NGUI 3 Support / Draggable Panel and Tabs changing
« on: November 07, 2013, 02:39:15 AM »
Hi! It's me again ;)

Can not figure out what's wrong (Attach video).
I have two tabs (UIToggle, UIToggleObjects) with their content.
Content: Clipped Panel, ScrollBar etc. Both contents are identical in structure, they are two different Chats (Public and Room).
When I receive the desired event from the server, I turn on the second tab (UIToggle.value = true) and show another content (Room chat).
As you can see from the video, there is some effect, as if the contents of the list shows all. It is visible only when scrolling list (either manually or through a scroll) and tab changing in same time, and only in release build (in the editor, it is impossible to detect).

Thanks!

15
NGUI 3 Support / Re: Draggable Panel content blurring
« on: November 07, 2013, 01:13:43 AM »
I am not seeing this issue in the scroll view example btw.

My steps:
1. Open Scroll View Example
2. Disable existing items.
3. Add UILabel to Grid. UILabel - Dynamic Font, Arial, 12, Resize Height, Correct. Clone item.
4. Grid vertical, set cell height, reposition now.
5. Disable background image (to make it easier to see).

See Attach image. Here it is not very noticeable (although you can see), but for example on some other dynamic fonts and
bitmap fonts it is very noticeable.

Pages: [1] 2 3 ... 10