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

Pages: [1]
1
NGUI 3 Support / Re: Keep UIButton highlighted
« on: May 21, 2014, 02:42:20 PM »
Figured it out.

Widget+UIButton+UIToggle
- ButtonSprite
- SelectedSprite

Set the UIToggle sprite to SelectedSprite.

Make sure to use a unique toggle group.

2
NGUI 3 Support / Keep UIButton highlighted
« on: May 21, 2014, 01:57:11 PM »
I have a set of buttons which represent tools, only one of which can be selected at a time.

I would like be able to keep the selected button highlighted and remove highlighting from the others.  For highlighting I was hoping to use a color but a second texture works too.

I tried UIToggle with a unique group and my UIButtons just disappeared and reappeared as I moused over them.

I can do what I want manually in code but I figured NGUI would support this.

3
NGUI 3 Support / Re: TweenPosition and Anchors
« on: May 13, 2014, 12:06:14 PM »
My goal is to tween a widget which is anchored to the top left of a UIPanel off screen and then back on screen.  So it slides away and slides back when needed. 

There is another widget anchored top right, same deal though.

The tweens just don't seem to work with anchors.  The anchor works regardless of resolution/aspect ratio.  The tween is absolute numbers so as soon as resolution changes the numbers are way off.   I see no apparent solution except to not Tween.

4
NGUI 3 Support / Re: TweenPosition and Anchors
« on: May 11, 2014, 06:53:55 PM »
I still have an issue with this.

So UIRoot is set to FixedSize.

Everything looks beautiful and resizes nicely when I change the game view resolution.  Everything looks great in the unity player.

If I build a PC build, the tweens carry the UIWidgets offscreen to far.

If I build an Android build the tweens carry the UIWidgets inscreen to far.

When the game view is in "Free Aspect" I get the same issue as Android, to far inscreen.

What option might I have checked or really what can I do to resolve this?  This is primarily a mobile app so I not concerned about PC builds but I cannot get it to look good in either.

I think the problem is that whenever Game View resolution updates, sure everything anchors nicely but the tweens fail to update their positions so when the tween plays everything goes to the wrong spot.


5
NGUI 3 Support / Re: TweenPosition and Anchors
« on: May 08, 2014, 08:05:26 PM »
Well apparently turning on ScalingStyle: FixedSizedOnMobile on UIRoot fixed most of my problems.

I still notice on Android the tweening breaks the UI but by far less now.  The offsets still are wrong, if I disable tweening then it anchors correctly.

Update:
- okay well with FixedSizeOnMobile enabled NGUI draws a bit offscreen on PC/GameView and draws to far inscreen on mobile.  With FixedSizeOnMobile disabled NGUI is perfect on PC/GameView but fails on all mobile devices (IOS and Android).

6
NGUI 3 Support / TweenPosition and Anchors
« on: May 08, 2014, 07:41:49 PM »
I googled around and read the forums, from what I gather this is both possible and impossible.  I think older versions of NGUI anchors + tween was impossible, newer versions it appears possible.

So I have a setup like this, basically a big container for buttons.

UIRoot
-Camera
--Panel
---ContainerMain
----ContainerButton
-----Texture

ContainerMain is anchored to Panel.
ContainerButton in anchored to container main.

I have two TweenPositions set on ContainerMain, one to slide it in and one to slide it out.  I fire the tween in script.

This is where it breaks down.  This breaks resolution independence.  The anchor does its job but the tween seems to work in absolute numbers.

7
NGUI 3 Support / Re: NGUI 3.0.7 Resolution Independence
« on: May 06, 2014, 02:07:11 PM »
I add a 2D UI -> camera -> panel -> container -> sprite.

I set the containers anchor to unified and adjust as I want it.

Looks good in Game mode, if I hit play it looks good.  If I deploy to an Android phone the GUI is mostly off screen.

8
NGUI 3 Support / NGUI 3.0.7 Resolution Independence
« on: May 06, 2014, 12:45:05 PM »
I purchased NGUI hoping it would save me some time.  If I actually get it working shortly it still might otherwise I've burned a whole ton of time on NGUI.

I would like to snap a GUI on the left and right side of my landscape screen.  This works fine for some devices (using the new anchor system) but as aspect ratios change and resolutions change the GUI is lost.

I also notice a disparity between the SCENE/GAME view and the 'Play' view.  While the scene might look great in scene builder and game view as soon as the play button is pressed things jump around (get smaller in this case). 

All tutorials I find are for older NGUI. 


Pages: [1]