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

Pages: [1]
1
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?

2
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.

3
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?

4
NGUI 3 Support / Drag and Drop Prefabs
« on: September 12, 2012, 02:04:06 PM »
I am having a problem dragging instantiated prefabs. I have a standard UIRoot with anchor and panel. I've attached the UIDraggablePanel script to the panel as well as a collider. I have a prefab with a root gameobject with a collider and UIDragPanelContents script on it and a SlicedSprite child object. I instantiate a new instance of the prefab like so; 

  1. GameObject obj = NGUITools.AddChild(this.gameObject, MyPrefab);
  2.  

The problem is; when I try to drag one of the instances they all drag. I am guessing that I have set this up wrong. I tried moving the UIdraggablepanel script to the gameobject of the prefab and adding a UIpanel script to it and then moving the uidragpanelcontents to the slicedsprite but the sprite didn't drag at all.

Any insights?

5
NGUI 3 Support / Persisting Chat Dialog across scenes
« on: September 12, 2012, 09:05:11 AM »
I have a multiplayer game with multiple scenes. When players enter the game their friends are notified and so can start chatting with the player. The problem is, I need to the player to be able to change scenes without closing the chat dialog. I was thinking that I can place the chat dialog in the first scene after authentication and then use LoadLevelAdditive for all subsequent scenes to persist the chat dialog. The problem is, there can only be one AudioListener per scene and NGUI creates one for the camera. I have tried removing the listener but it seems to be created in code. Is there perhaps another way of accomplishing this or another way to make NGUI work with LoadLevelAdditive?

Thanks

6
NGUI 3 Support / Scaling a sprite between two sprites
« on: August 25, 2012, 09:49:26 AM »
Sorry, new to NGUI so forgive me if this is dense or already documented somewhere. I couldn't find anything.

My UI has a banner across the top which is 40px high. It has a status bar across the bottom that is also 40px high. I now want to place a sliced sprite so that it scales between the banner and header bar. When I anchor it center and stretch it vertical it stretches from the top of the window to the bottom but I want it to stretch to the bottom of the banner and top of the status bar. What is the best way to do this? I noticed you have a table object but it seems to require rows to be the same height.

Thanks

Robert

Pages: [1]