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

Pages: [1]
1
NGUI 3 Support / Scrollview : Keep selected item in view
« on: September 30, 2015, 03:43:08 AM »
I'm using a scrollview for a list of save slots. The number of slots is more than can be seen at once. The only input device is a controller.

At any given time, one of the save slots is the UICamera.selectedObject, and the player can use the controller to change the selected object/save slot (using KeyNavigation). However it's possible to select slots that are out of view of the scrollview.

Is there a way to ensure that the selected object is inside the viewable region of the scrollview?

2
NGUI 3 Support / Re: Virtual coordinates
« on: February 22, 2015, 11:19:00 PM »
" move a widget from the centre of the screen to the top-left corner in code"

I guess that wasn't clear...I meant animate a widget over a number of frames. So it starts centred then moves smoothly to the top-left corner over a second. The numerous aspect ratios mean that the widget finishes in the incorrect position in a lot of cases is I use a constant value or a Unity animation.

In the example "pixels * UIRoot.GetPixelSizeAdjustment(gameObject)", what is the range for "pixels" to achieve the above?  [0..Screen.width]?  [0..1]?

3
NGUI 3 Support / Virtual coordinates
« on: February 20, 2015, 10:20:41 PM »
Hi.
I'm using "Constrained" scaling, and I'm trying to move a widget from the centre of the screen to the top-left corner in code. Because the screen resolution can change, I think I need to work out the "virtual co-ordinates" of the top-left corner, but haven't been able to do that yet.

How do I get the virtual coordinates of the top-left corner of the screen?

Thanks.
Paul
Black Lab Games.

Pages: [1]