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

Pages: [1]
1
NGUI 3 Support / Re: Last Touch Position
« on: January 23, 2014, 11:48:34 AM »
I was pretty tired last night, but yes I would agree lastTouchPosition would not be a world position!  :-\

The problem I am having is not really an NGUI problem at this point, it is my lack of understanding how to spawn objects in different coordinate systems. I will continue to experiement.


2
NGUI 3 Support / Last Touch Position
« on: January 23, 2014, 01:00:44 AM »
Hello,

I am using an NGUI widget as a spell bar for a mobile game. This is what I am trying to do:

1. The widget is listening for a touch to start within its collider, for this I am using OnPress(true)
2. For the user to cast the spell the touch will need to be dragged off the widget's collider. I am using hoveredObject to determine when the game object's tag changes
3. Once step 2 happens I want to spawn a gameObject (Non-NGUI object)  at the location lastTouchPosition (using PoolManager5 to spawn object, so the object is spawned as a child of my pool manager which is a child of UIRoot)
4. I want the gameObject to follow the touch until OnPress(false)

The problem I am having is step 3 and 4

Is lastTouchPosition is a screen point or a world point? I am assuming screen point. So I am trying to get this to local space.

I take the lastTouchPosition and convert it to a Vector3 and do ScreenToWorldPoint using the UICamera. Then I do transform.InverseTransformPoint and set this value to my spawned object's transform position. My spawned object is way…I mean way out in space. I am confused on how this all works, am I on the right path? I also tried doing this with UICamera.lastHit.point and it is still not working.

Also can I use OnDrag(delta) to have the gameObject follow the touch? I would just add the delta values to the gameObject's transform.

I would appreciate any guidance or suggestions.

Thank you!
 

3
NGUI 3 Support / Re: Detecting when drag moves off a collider
« on: January 22, 2014, 09:07:27 PM »
Wanted to share a quick update

I am sure there might be a better way, but I was able to get this behavior by checking the tag in the UICamera.hoveredObject in the OnDrag event handler. Once I detected the tag changed from the touched gameObject I knew the touch was dragged off the collider.

4
NGUI 3 Support / Detecting when drag moves off a collider
« on: January 22, 2014, 08:28:25 PM »
Hello all,

I am looking for a way to detect when when a touch drags off a collider. For example a touch is detected on a collider with OnPress() then I would like to know when that touch drags off that collider.

After reviewing the UICamera's notification events I didn't see a specific notification for that.

Thanks

5
NGUI 3 Support / Re: Unity 2d sprite and NGUI
« on: January 12, 2014, 07:33:11 PM »
Hi  ArenMook,

Thanks for the reply I was thinking of that for the sprites that needs to be on top. Do you have any suggestions for Non-NGUI sprites that will be in between NGUI panels? I am trying to keep this to a minimum but I do have a few.

Best Regards 

6
NGUI 3 Support / Unity 2d sprite and NGUI
« on: January 12, 2014, 12:20:12 AM »
Hello,

I am trying to find information on how to handle having Unity 2D sprites with a NGUI framework. All of my menus and interacting widgets are NGUI, but I also need to use Unity's 2D sprites in the game scene. I have seen a few posts from ArenMook stating that there are issues with this currently and that Unity 4.5 might address this. I can't wait until 4.5 comes out  :(

One problem that I am having is the rendering order of NGUI components and Unity's 2D sprites. I can understand this since NGUI does not use Z depth for the draw order. One way I fix this is by adjusting the Z value on the Non-NGUI sprites so it is closer to the camera. I feel like this is playing with fire if it is within an NGUI framework (I have seen my sprites appear behind an NGUI component on one device and on top of it on another device). All of my sprites will need to be drawn last, so I can continue to adjust the Z value until this is consistent. How can I solve this problem the right way? Or is this an acceptable approach?

I would use UI2DSprite class but it is not integrated within Unity's sprite animation work flow. After using NGUI I do not want to go back to EZGUI. Anyone have suggestions on how this can be done correctly?

Best Regards!

 

7
NGUI 3 Support / NGUI Best Practices
« on: December 28, 2013, 08:46:47 PM »
Hello all,

I was wondering if there was a collection of best practices (optimization tricks) when using NGUI. I couldn't find one centralized place. For example is it recommended to deactivate a panel if it goes off the screen? Looking to take the arcane knowledge of NGUI best practices that cannot be derived from the documentation (or easily from new users) into one collection.

I think it would be a great thing to have something like this from experienced users and the developer! Maybe we can start with this thread, if you know a great resource (other than the docs ;o) were people share their thoughts or if you have thoughts. Post it here!

Thanks

8
NGUI 3 Support / Re: UIGrid items not rendered correctly
« on: December 28, 2013, 08:30:41 PM »
Hi Aren,

Wanted to give you an update to this. I have not been able to reproduce the problem on the mobile device, this only seems to be happening within the Unity IDE. Any thoughts?

Thanks

9
NGUI 3 Support / Re: Tweens not replaying correctly
« on: December 27, 2013, 05:15:23 PM »
Here is my setup

tigger condition - On Click
Play Direction - Forward
If Target is  disabled - Do Nothing
if Already Playing - Continue
When Finished - Do not disable


If I call the tween's play forward and play reverse functions from code, it will always work. It seems like this problem only exists if I use UIPlayTween

10
NGUI 3 Support / Re: UIGrid items not rendered correctly
« on: December 27, 2013, 04:59:59 PM »
No I was mistaken, there is no scaling issue. The items are clipped and not in the correct position when they first come on to the screen. As soon as I scroll the list they will snap to the correct position and become "unclipped".

I am not scaling anything within this panel. I am moving the panel with the tween position script.

Here is how I have it setup (-->Parent of)

(This is the object I am tweening)Panel-->(Also contains a panel for the title)UIScrollView-->UIGrid-->Grid Items (each item contains UIDragScrollView)

I have sent another screen shot, it appears the UISprites are being shifted. Then clipped since they are going outside of the panel container. This happens 50% of the time. Then if I scroll the list, it will correct itself



Thank you

11
NGUI 3 Support / Re: Tweens not replaying correctly
« on: December 26, 2013, 09:33:42 PM »
Hi Aren

I am using version 3.0.7f3. I am using UIPlayTween to call the tween animations on the objects

12
NGUI 3 Support / Re: UIGrid items not rendered correctly
« on: December 26, 2013, 09:32:10 PM »
I am using version 3.0.7f3

13
NGUI 3 Support / UIGrid items not rendered correctly
« on: December 26, 2013, 04:32:34 PM »
Hello,

I have a UIGrid within a panel that moves on and off the screen. Sometimes when the grid moves to the screen the items within the grid are clipped and not centered and well as the scale being off. As soon as you scroll the list, it will snap into place. This is on a mobile system.

I have attached two screen shots of what I am talking about.

Has anyone seen this or have a fix?

Thank you

14
NGUI 3 Support / Tweens not replaying correctly
« on: December 26, 2013, 04:13:50 PM »
Hello all,

I have some simple Tween position scripts on my panels to move them on and off the screen. When the appropriate button is pressed it will trigger these tweens.

Each of these tweens has an animation curve and a duration. The duration will work the first time the animation is played, but anytime after that it will just "warp" to the position, ignoring the duration and/or animation curve (This is setup all in the Unity inspector)

I did see a few posts on this issue, and it was said to be addressed in a earlier version of NGUI. I am using the latest version and it does not appear to be fixed.

Anyone see this problem? This seems straightforward, am I missing something?

Thanks!

15
NGUI 3 Support / NGUI and Game Camera
« on: December 20, 2013, 01:00:54 PM »
Hello All,

I recently purchased NGUI and I think they did a great job with the workflow!

I am coming from EZGUI, so I wanted to ask this forum a best practices question on NGUI and game cameras. I am designing a new mobile 2D game that will contain different menus and the actually game scene with a few NGUI components (i.e. a pause button). My question is should I make a separate camera just for the NGUI menus and then a separate camera just for the 2D game view? Or is it ok just to use NGUI camera for both?

My game will also need to receive touches from the user and I am not sure if this will cause issues with NGUI. I am looking for any thoughts or advise from people who have done this before.

Thank you,
Eric

Pages: [1]