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

Pages: [1] 2
1
NGUI 3 Support / Re: Justify Alignment for Text
« on: November 11, 2013, 07:21:18 AM »
I will add my vote for needing text justification/alignment in NGUI.  Working on a sim for the US Navy and as you would guess they like things to line up nicely in the text portion of the sim instructions.

Thanks!

2
NGUI 3 Support / Set sprite depth with javascript?
« on: October 22, 2013, 08:44:31 AM »
A noob question, but I got to ask...Is it possible to set a sprites depth using javascript?
Can someone show me some example code?

3
In my game I have objects randomly appearing and when the user clicks on any one of objects I need to store what object/s they clicked on and in what order the user clicked on them so that at the end of the game (when the timer runs out or the user clicks on at least 6 objects)  on the results page I can show a vertical column of icons that represent each object clicked on with the first object's icon at the top of the column and the last object's icon at the bottom.  I understand that I probably need to code some type of array or table to handle this but being the noobie I am, I am not sure how to get this going.  I have looked at the UITable and read the write up on the Character Inventory System, as well as played with the Inventory System example in NGUI.  Still am lost.  Could I get some guidance and a suggested approach (UITable, Inventory System, etc) and some code examples to get me started.

4
Thanks Aren for the reply.  I sorted it out and I apologize for any confusion. Had to just sit back and work through it after a night's worth of sleep.

5
My title may not adequately describe what I am trying to do. In my NGUI UI I have a panel (ID_Panel), with a script attached. In the script I have a variable setup (var This_Panel_Object : GameObject;).  Over in the Inspector I dragged one of the sprites (Sprite_Sailboat) belonging to ID_Panel  into the Game Object slot so that when the game is running and the ID_Panel is active the sailboat sprite is displayed.

What I want to have happen is when the user clicks on another object (let's say a seagull) in the game, the sailboat sprite fades off and a seagull sprite (Sprite_Seagull) fades in.  I have the fade in and out part down I believe, but I am not sure how to code things so that the Sprite_Sailboat sprite in the This_Panel_Object variable gets replaced with the Sprite_Seagull sprite allowing the seagull sprite to be be displayed.  Hope this makes sense.

6
NGUI 3 Support / Re: Clipping a moving panel
« on: August 07, 2013, 06:06:29 AM »
Yes I agree 100% with you.  I found that out through my experimentation.  So how do I keep a panel's clip area static so that I move all the widgets (it's children) and have them clipped as they run into the clipping area.  I guess I could apply a TweenPosition to each one of the widgets individually, but I was trying to avoid that and move them all as a group.

Would parenting all the widgets that belong to my panel to a empty GameObject, then applying the TweenPosition to the game object work?

Thanks!

7
NGUI 3 Support / Clipping a moving panel
« on: August 06, 2013, 01:23:42 PM »
I have a panel that I would like to slide across the screen and be clipped as it runs into a clipping area.  I created a panel, defined a clipping area using that panel's  Panel Tool and sent the panel across the screen using TweenPosition.  Duh!  As I suspected the clipping area moved right along with the panel and thus the panel never got clipped. So my problem probably has a simple answer, but can someone tell how do i set up a clipping area/mask that will clip the panel when it runs into it.  Thanks ahead of time.

8
NGUI 3 Support / Re: Can't make the sprite wait for the mouse click
« on: August 05, 2013, 09:19:03 AM »
Thanks!  I am way short on sleep and your help is getting me through this.  Much appreciated!

9
NGUI 3 Support / Can't make the sprite wait for the mouse click
« on: August 04, 2013, 10:43:45 PM »
Following NGUI examples I have a TweenPosition script on my sprite which makes the sprite translate a given distance along the Y axies .  On my button I have a UIButtonTween script with the sprite mentioned designated as the target, and the Trigger as "OnClick".  This is based on what I see in NGUI Example 2.  The problem s when I run the "game" the sprite takes off and  moves on its own and doesn't wait for the button click.  Must be something simple but I don't know how to keep the sprite in its original position until the button is clicked.  By the way the button and sprite are contained in the same NGUI panel.  ArenMook can you show me the errors of my ways.  Thanks

10
Believe I have figured it out.

11
Yes that was the reason things were not fading!  Thank you!  Figures it was something subtle like that.

  Would it be to much to ask how to I set up to have a second panel "underneath" the first. So that as the first fades away the "underneath" panel is revealed?

Thanks again, much appreciated.

12
Thanks for the reminder ArenMook, I tried that and the sprite in the right hand screen still did not fade. Now the interesting thing is I ran several experiments and discovered this:
(BTW the sprite I am working with in the right screen fills the display)

If I create a second sprite the same size as the first and fill it with a solid color (black) and put its depth at say -1 and I have the first sprite's depth set at 2, add my fade script to the first sprite, create the standalone and run it. Bingo! The first sprite fades off the right hand monitor like it should.  I don't understand why this works but it does.  I also still do not know why without that second sprite behind the first, the first does not fade off. BTW I did activate and leave "run in background" on too.  Any further thoughts I would appreciate hearing them. 

Would it be easier to just fade the panel or the whole UI Root up the hierarchy chain?  Thanks!

13
I can't figure out how to make this happen:  I have a Unity executable whose display rez is 3000x1920. So that the game and GUI's are spread across two 1920x1080 monitors. The left one in landscape orientation and the right one in portrait orientation (lft: 1920 + rgt: 1080 = 3000, with the vertical rez = 1920).  In mu game, I have two NGUI UI's created one ( a minimap sitting over the main game) sitting on the left monitor, and the other UI (the main user interface) on the right monitor.  I have written a fade script using Tween.Alpha that I have attached to a sprite in each respective UI.  On a mouse click both sprites are to fade off.

Inside the Unity editor when I click the mouse both sprites fade away nicely.  But when I run the associated Unity stand alone executable where each sprite is on its respective monitor
if I mouse click with the cursor on either screen the left sprite fades off but the right one doesn't fade off.  I am to demo my progress to a customer on Monday so I am in a bit of a crunch.  Any fast help would be greatly appreciated!

14
Ok thanks for the input Aren.  Is there any possibility that the update to NGUI's latest version that I did yesterday about the same time my NGUI elements disappeared have anything to do with the problem?

15
Ok, I believe I pulled a real bonehead move.   I am a bit desperate here. In the Unity Project window I was moving things around a to organize things better. Hit the editor play button and realized my NGUI panel and all the elements (sprites & elements) had disappeared.  Could not tell what happened so I saved the scene and jumped into an earlier version of my scene that I knew worked that I had saved as a backup.
Same thing, no NGUI elements in the game view, but all the elements are in the Hierarchy window. 

Discovered that I had inadvertenly moved the Atlas folder into another folder. Ugh!
My assumption is that is what caused everything to disapper. Placed the Atlas folder back where it belonged in the Asset folder. Dragged and dropped the Atlas onto each of the NGUI sprites hoping that would "fix" things.  NADA!  Still no NGUI sprites or labels show up in the game view.  I really need some help here, supposed to be demoing my work in the next day or two.  How do I get the NGUI elements to reappear?  Thanks ahead of time.

Pages: [1] 2