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]
NGUI 3 Support / Re: Drag and Drop Prefabs
« on: September 14, 2012, 12:18:05 AM »
That helped. Should the clipping size automatically change to fill the screen or do I need to script that? The way it is the draggable area is very small. I can set a static size but that doesn't seem to fit with the objective of fitting to many screen resolutions so once again I think I'm missing something.

NGUI 3 Support / Re: Drag and Drop Prefabs
« on: September 12, 2012, 11:12:34 PM »
Another step further. I added the UIPanel script to the root game object of my prefab. I also added the UIDraggable Panel script. I then added the UIDragPanelContents to the Background of my dialog. Unfortunately, I can still drag the dialogs off the screen, even after checking, restrictwithinpanel. It does a better job with layering but I am still going to need to create a script to handle focus and bringing focused dialogs to the front.

NGUI 3 Support / Re: Drag and Drop Prefabs
« on: September 12, 2012, 10:01:40 PM »
That helped a lot. So the Panel of the UI root has no scripts or colliders now. The Prefab has the UIdragobject script. When I instantiate the prefab it is dragable. Nice. But I am able to drag the dialog off the screen. I tried setting the prefabs target to the panel but the dialog stopped being dragable. So without that I guess it doesn't know its bounds.

I also need to resolve layering. Since I am creating a number of dialogs they tend to overlap each other; ie the header of A layering on top of the background of B while the background of B layers on top of the background of A. I guess when I instantiate them I need to set the depth and then when each is given focus I need to bring it forward.

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);

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?

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?


NGUI 3 Support / Re: Scaling a sprite between two sprites
« on: August 25, 2012, 08:30:23 PM »
Already done. I added height and width offsets to the UIStretch scripts. I was just wondering if there was already a widget or script that did this so I could follow the correct standard. I would recommend a split panel for future iterations that allows you to fix the size of one and dynamically scale the other.

Thanks for your help Aren.

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.



Pages: 1 [2]