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

Pages: [1] 2
1
NGUI 3 Support / Re: 3.0 UIInput Select on Tab Function Broken?
« on: December 23, 2013, 09:22:04 PM »
Sorry, when I saw the readme versioned at 3.0.2 I thought I was up to date. Problem is resolved.

2
NGUI 3 Support / Re: 3.0 UIInput Select on Tab Function Broken?
« on: December 23, 2013, 02:15:48 PM »
Sorry, should have included it; 3.0.2. I have a temporary fix. I added a static bool to the UIInput script called tabbed and set it to false, then made the following change to update;

  1.                
  2. if (selectOnTab != null && Input.GetKeyDown(KeyCode.Tab) && tabbed == false)
  3. {
  4.         tabbed = true;
  5.         Debug.Log("Tabbing from " + UICamera.selectedObject.name + " to " + selectOnTab.name);
  6.         UICamera.selectedObject = selectOnTab;
  7. }
  8. else
  9. {
  10.         tabbed = false;
  11. }
  12.  

3
NGUI 3 Support / Re: 3.0 UIInput Select on Tab Function Broken?
« on: December 23, 2013, 01:57:23 PM »
Having a similar, possibly related problem. I have six inputs, when I tab from the first to second, no problem but when I tab from second to third it jumps to the last. After inserting debugs through the uiinput script I found that it seems to be repeating the tab multiple times because I can see it jump from control to control in code.

4
NGUI 3 Support / Re: Setting focus on input widget in code
« on: September 24, 2012, 10:50:59 AM »
That doesn't work for me. I just get a pipe character in my input but the input itself does not have focus. If I start typing nothing appears in the input. Behind the scenes the selected property is doing exactly what I was doing manually in code, setting the camera's selected object, which didn't work for me either.

5
NGUI 3 Support / Re: Setting focus on input widget in code
« on: September 24, 2012, 08:08:07 AM »
thanks jorel but I don't understand how that code gives the input control focus. That method gets called when the control gets focus but that is not what I am trying to do.

6
NGUI 3 Support / Setting focus on input widget in code
« on: September 23, 2012, 08:01:16 PM »
I've been trying to figure out how to set focus on an input widget in code. I have tried Sending a OnClick, OnSelect and OnPress event to the input gameobject but no luck. I have tried setting the camera's selectobject to the input but all that I get is a pipe inserted into the input field. The input still does not have focus. Has anyone done this?

7
NGUI 3 Support / Re: Sliced Sprite edges Blurring
« on: September 19, 2012, 06:57:05 PM »
I had a similar problem. I had a two pixel border that was blurry when I set the border to 2. I think that is because the half pixel offset leaves 1/4 of the border on the stretchable part of the sprite. When I set the border to 3 the blurriness went away. So make sure you set the border on the atlas to be at least one pixel greater than the border on your image.

8
NGUI 3 Support / Re: Resizeable Dragable Sprite
« on: September 16, 2012, 08:38:35 PM »
OK I don't think we are understand each other at all. I'll start again from the top.

I require a chat dialog box. I can have zero or more dialogs on screen at any one time. Each dialog should be resizeable and dragable, ie the user can change the size and/or position of the dialog. If the user clicks on the dialog within x pixels of any edge the dialog goes into resize mode and the user can drag the edge to whichever extent they like; otherwise the dialog is simply dragged to a new location. This is pretty standard behaviour for chat dialogs in general.

My Problem is NGUI does not support this resizing natively so I have to write something. So how do I turn off the automatic drag functionality when the user is near an edge of the dialog, so that can intercept the OnDrag calls and resize the dialog?

The dialog is designed as follows; UIPanel with DraggablePanel script, SlicedSprite with DraggablePanelContents script. Dragging works fine. Now I have to figure out resizing.


9
NGUI 3 Support / Re: Resizeable Dragable Sprite
« on: September 16, 2012, 11:06:13 AM »
Don't know how that would work. The clipped panel doesn't change the size of the contained widgets. It just changes the limits the widget can be dragged. And I still need to drag I just don't want the widget to move, instead I want to change the size and or position based on the edge selected.

10
NGUI 3 Support / Re: How to get the Panel pixelwidth?
« on: September 15, 2012, 11:52:54 AM »
I think this is a word order problem, you aren't looking for the "pixel size" which would be 1, you are looking for the "size in pixels" of the button, which would be the size of the  background I am guessing.

11
NGUI 3 Support / Resizeable Dragable Sprite
« on: September 15, 2012, 11:48:46 AM »
I have a UIPanel with the UIDraggablePanel script and within that a SlicedSprite which is the background and "container" for other controls. This is my chat dialog. I have this defined as a prefab and can have a number of them on screen at any one time. Now I am trying to add the ability to resize the panel. If the user hovers within x pixels of any edge the resize icon should be displayed and the user should be able to drag the edge within predefined limits. Of course this means the dialog itself should not be dragged during the resizing operation. I just wanted to check with anyone to see if this has been done before. Right off the bat I need to be able to determine if the mouse is close to an edge of a sprite, then I need to turn off dragging the dialog on mouse down and instead pass the delta of the mouse position to the correct dimension of the sprite transform. Any helpful suggestions would be most appreciated.

12
NGUI 3 Support / Re: Drag and Drop Prefabs
« on: September 14, 2012, 10:59:38 PM »
So this is my solution, it may suck but it works;

First I added another value to the enum Clipping called screen;
Then I added the following logic to UIPanel - clipRange - Get

  1. return this.clipping.Equals(UIDrawCall.Clipping.Screen) ? new Vector4(mClipRange.x, mClipRange.y, Screen.width, Screen.height) : mClipRange;
  2.  

I haven't tried it in a screen that changes size at runtime but it works fine to handle multiple static screen resolutions.

Perhaps someone can recommend a more elegant solution.

13
NGUI 3 Support / Re: Setting Z-Index on UIPanel
« on: September 14, 2012, 10:21:32 PM »
switched to;

  1. MyDialog.transform.localPosition = new Vector3(MyDialog.transform.localPosition.x, MyDialog.transform.localPosition.y, this.Sequence); 
  2.  

And everything works fine.

Thanks

14
NGUI 3 Support / Setting Z-Index on UIPanel
« on: September 14, 2012, 03:05:10 PM »
Strange problem I am trying to set the z value on the transform of the UIPanel gameobject but the value is being altered. First here is the line that changes the z value;

  1. MyDialog.transform.position = new Vector3(MyDialog.transform.position.x, MyDialog.transform.position.y, this.Sequence)
  2.  

where Sequence is an integer that represents the order in which they are displayed.

If I set the value to -1, the actual value appears as -241. If I set it to -2 the actual value is -482 and the UIPanel disappears outside the view.

Is NGUI changing this value? If so, what is the best way to layer panels for display?

15
NGUI 3 Support / Re: Drag and Drop Prefabs
« on: September 14, 2012, 09:50:40 AM »
That's what I figured. I was hoping it auto-resized to fill the screen or container. I might trying adding that feature to the UIPanel script.

Pages: [1] 2