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

Pages: 1 2 3 [4]
NGUI 3 Support / Re: Position Sprite/Texture like a rectangle
« on: July 17, 2013, 12:09:12 PM »
You may want to take a look at the UIAnchor.cs component. Most of the NGUI Example scenes make use of this, and you can use it to both choose which portion of the screen you want to lock to, as well as the offset (a percentage) you want to use.

NGUI 3 Support / Re: UIAnchor positioning in the wrong place
« on: July 15, 2013, 08:35:35 PM »
1. This is the intended behavior, and yes, you need to use offsets.
I usually create an empty GameObject for my button alignment, and then position my buttons beneath that. You could try fiddling with the offset values to bump it to the right slightly, but the button alignment gets skewed on different devices because of the changes in screen dimensions.

2. Did you add the UICamera component to your own camera? If you do, does it work? By the look through the code, UIPanel is looking for a UICamera, and although UIAnchor is just using a "Camera", it has the same construct as the UIPanel. Another thing to check: Is the layer of your button set to UI (or whatever your main camera is set to render)?

NGUI 3 Support / Re: Pause tweens without modifying Time.timeScale
« on: June 24, 2013, 07:59:42 PM »
Disabling the components did it. I didn't even think to try that.

Thanks for answering the question for me!

NGUI 3 Support / Re: Pause tweens without modifying Time.timeScale
« on: June 21, 2013, 11:25:55 AM »
Right; I don't want to Time.timeScale = 0 because it'll affect all my background stuff.

What I want to do is pause the tweens themselves, while continuing all the rest of the game logic (background animations, music, particle effects, etc.).

Essentially, the only things that I do want to pause are NGUI's UITweener events (such as TweenPosition, TweenScale, etc.), not the other way around.

What about grabbing UITweener.tweenFactor, so I know how far it's gone so far in its tween, call UITweener.Sample() to update its localPosition, and then grab that localPosition value? That should give me the interpolated values and time spent on the tween, and then I could disable the tweener (you CAN disable them, right?) while the app is "paused". I would then just create a new tween from its current position and put in the remaining time so it continues on its path at the same speed as before the pause event happened.

NGUI 3 Support / Re: UIGrid get position of children
« on: June 20, 2013, 06:27:10 PM »
If you traverse up the GameObject tree to each of the cell nodes, do you get to a parent/root that shows different position offsets from each other?

I am using scale and position tweens for a twitch game. The GameObjects currently move, rotate, and scale around the screen correctly.

I am going to need a pause feature in the game, but pausing the game should not affect background animations, music, and some other UI element tweens.

I searched for other ways to "pause" a game and found many results here that discuss how to do this with Time.timeScale, but I don't believe that would work best for all the background things that I need to keep going.

Since I'll know my tween's initial duration as well as the starting and ending positions/scales, could I just grab its current tween time, then unsubscribe the tween? Then when the player resumes, I could manually interpolate the values (or restore them from saved values) and resubscribe the tween to "finish" their operations.

Or is there a better way already in place?  ;)

Pages: 1 2 3 [4]