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

Pages: [1] 2
1
Thanks bfriedman, your solution works for me. It sucks that I have to give the device a jiggle before the device auto rotates, but it is better than nothing until a solution is found!

2
Unity 5.1? Can I have a copy? I've always wanted to have something from 2 years in the future. :)

Your NGUI is quite a bit out of date, so I would start by updating to the latest version. After that, enable the Debug option on the UICamera so that you can see what the touch is interacting with. Beyond that, I'm not sure -- you will need to add some Debug.Logs there. I suggest covering your entire screen with a big collider and logging the UICamera.lastTouchPosition via NGUIDebug.Log in OnDrag.

Ha! I wish :(

I did as you asked after updating and was able to see the touch locations prior to the orientation change, but as soon as the orientation changed then the huge collider I put in the background to receive the touches no longer did anything. That was on iOS. On Android the huge collider continued to spit out values for me after the orientation change.

3
Hey,

I'm on NGUI 3.5.5 with Unity 4.5.1 (EDITED FROM 5.1  ::) ) and I'm trying to programmatically change the screen orientation of my iOS device (iPad iOS 7.1) for different parts of my game. The buttons are responsive and work until I change the orientation using for example
  1. Screen.orientation = ScreenOrientation.Portrait;

The buttons work with the rotation on Android (tested on a Nexus 5 4.2.2).

Once I do that, the buttons can no longer be clicked. I see the code in UICamera for detecting screen changes gets executed, so the UIAnchors must be getting updated as well. What could be preventing my buttons from being responsive again?

Thanks.

4
Thats unfortunate, I was being lazy and hoping there was functionality for dragging a widget within the bounds of another widget. Thanks for replying.

5
That was the case, thanks for getting back to me. Is there a list of illegal places to do operations like this documented anywhere so I don't lose time in the future? Thanks!

6
I have a UIDragObject script attached to a UITexture where the drag effect is set to 'momentum', the Keep Visible flag ticked and the ContentRect set up to be another UITexture.

If I click on the object and drag it around it stays roughly within the bounds of the other UITexture. However, if I drag the object to one of the boundaries and lift my finger off the mouse button, then click again and start dragging up I get to drag the object out of bounds for about another 20% before it catches it again. I can do it repeatedly until the object is well out of the bounds of the content rect.

I am using the current version of NGUI and Unity 4.3.

Thanks.

7
NGUI 3 Support / UITexture doesn't show when programmatically created
« on: June 06, 2014, 09:33:14 AM »
I have a UITexture in my scene with no variables linked up to it. During runtime, I programmatically create a texture and assign it to the UITexture. I can see the texture that is created and see it linked up in editor. However nothing displays in my scene. I have tried changing the main texture and creating a new material.

Here is my code for setting the texture
  1. public void SetTextureTo(Texture2D tex) {
  2.  
  3.                 /*
  4.                 Material newMat = new Material(Shader.Find("Unlit/Transparent Colored"));
  5.                 newMat.mainTexture = tex;
  6.                 _tex.material = newMat;
  7.                 */
  8.                 _tex.mainTexture = tex;
  9.  
  10.                 _tex.width = tex.width;
  11.                 _tex.height = tex.height;
  12.                 _tex.MarkAsChanged();
  13. }

Interestingly enough, if I call _tex.panel.Refresh(); after the method then the UITexture displays, but I get a null reference exception because _tex.panel is null (I don't have it managed by a panel). If I have a panel for it or create one through CreatePanel() then the error disappears but the image doesn't show again! So really, I can't get my image to display without causing an error  :o

I am running off the latest version of NGUI on Unity 4.3

Any suggestions?

Thanks

8
NGUI 3 Support / Re: UIDraggablePanel: Help with overshoot
« on: December 18, 2013, 05:55:18 AM »
Also replying to say thanks for the fix. Can't believe this still exists.....

9
NGUI 3 Support / Re: Expanding elements in a UIGrid
« on: November 08, 2013, 10:34:11 AM »
Have you looked at UITable? Because that's exactly what it does -- lets you resize content elements while still keeping them positioned.

Look at the quest log example.

Thanks, that's saved me some time! Why does UIGrid not have the same functionality out of curiosity?

10
NGUI 3 Support / Expanding elements in a UIGrid
« on: November 07, 2013, 10:28:06 AM »
Hey there,

I am working on making a UIGrid with expanding elements for a shop interface. Simply you click on one of the elements in a vertical shop and the image expands down and reveals more information.

I have an extended UIGrid that can have cells with different heights but I'm having problems with the bounds of the UIGrid. I can see the bounds dictated by the orange box in the editor. When I change the sprite height of an element in the grid the bounds goes all silly. I have demonstrated this by the 2 screenshots.

I looked in UIGrid.cs and could not see how the boundaries are being set. Could you please point me in the right direction or would I be better off writing my own Grid class to manage a collection of elements with dynamic sizes?

Thanks in advance. Forgive the lovely placeholder images....

EDIT: I am using the latest version of NGUI with Unity 4.2

11
NGUI 3 Support / Re: NGUI Tiled Sprite producing alpha border
« on: October 22, 2013, 04:11:38 AM »
Alright guys, thanks for the advice!

In your case, your file has transparent border? ???

Lol not on our side :p

12
NGUI 3 Support / Re: NGUI Tiled Sprite producing alpha border
« on: October 22, 2013, 01:45:08 AM »
I'm not sure how else to ask the same thing I have already asked.

First of all, don't use such small images for tiled sprites.

Alrighty.

Can you recommend an optimal image size for repeating textures?

"Give your sprite a border" does not answer my question.

13
NGUI 3 Support / Re: NGUI Tiled Sprite producing alpha border
« on: October 21, 2013, 01:35:55 AM »
Alrighty.

Can you recommend an optimal image size for repeating textures?

14
NGUI 3 Support / Re: NGUI Tiled Sprite producing alpha border
« on: October 20, 2013, 03:45:40 PM »
Can you recommend an optimal image size for repeating textures?

Also why do I have to account for the alpha border in all my textures? Can't I just disable the feature?

Cheers.

15
NGUI 3 Support / Re: NGUI Tiled Sprite producing alpha border
« on: October 18, 2013, 05:36:56 AM »
The atlas creation with 2.7.0 seems to adds a half pixel smoothing to the edges of the sprite in an atlas. How do I disable this?

Pages: [1] 2