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.


Topics - RobBrooks

Pages: [1]
1
NGUI 3 Support / UILabel.parent != UIlabel.transform.parent
« on: May 13, 2015, 08:13:47 AM »
This is a bit of a strange one, as I've managed to get away with a few of these (typos) in my code *until* I upgraded to version 3.8.2

I've got a reference to a UILabel representing a decimal value and that's parented to another UILabel which contains a string describing what the value means.

Sort of:

UILabel "Bonus Multiplier = "
    >UILabel "100"

If the value itself is zero, I decide to SetActive(false) the parent so that both the value and the parent label containing the string description aren't displayed.

Anyway, I failed to dereference to 'UILabel.transform.parent.gameobject' for the SetActive(false), instead just using 'UILabel.parent.gameObject', but prior to my upgrade, this worked fine.

Indeed, this DOES continue to work fine on the first pass when the parent UILabel is deactivated ( and as a consequence the value label )  but on the second pass, instead of the *value* UILabel's parent reference being 'correct', it instead references UIRoot and any deactivation I apply to that results in, rather unsurprisingly, the whole UI disappearing.

The value UILabel is buried several deep in the hierarchy, well away from UIRoot, so I'm not sure how this leap is occurring.
 
I have of course now corrected this by explicitly using the 'correct' transform.parent method, but I'd be really interested to hear any theories as to why this new behaviour has decided to manifest just after an NGUI update and not before?

Many thanks.

2
Upgraded Project to Unity 5. Now Upgrading NGUI to 3.8.2

Has this, at the bottom of UIAnchor script just been overlooked or have a perhaps 'crossed the streams' somewhere?

I figured it might be worth checking before I just go ahead and correct it to "Use orthographic".

Cheers,

Rob.


3

Hey all,

I've got to include an onscreen keyboard in our title which supports loads of crazy languages and I was wondering whether any of you have any recommendations for any turnkey solutions that might be out there?

The platform is Unity5 with NGUI, PC with a Gamepad.

Cheers,

Rob.



4
NGUI 3 Support / Resizing UITable with respect to parent UIScrollView.
« on: February 06, 2015, 09:55:26 AM »
I have a prefab featuring a vertical UITable 'inside' a vertical UIScroll View.

The table contains 10 elements.

I disable 2 of these elements from the middle of the UITable during runtime.

The UITable correctly closes the gaps and displays only the enabled elements.

However, the original overall height of the UITable is still considered by the containing UIScrollView to be valid, and instead of only allowing vertical scrolling to the bottom of the new UITable contents, it allows scroling past the contents and into a blank area which represents the vertical size of the 2 elements that have been removed.

What is the correct sequence of events required to 'inform' the UIScrolView that the UITable bounds has changed, and that it should redefine its limits accordingly?

Many thanks.

Edit - I think the logistical issue with the system, as far as my usage of it is concerned at least, is that all Reposition()ing appears to be deferred until Update. A check for UITable's disable state followed by a Reposition() of the UIScrollView  in the Update function of the script responsible for managing the contents of the UITable appears to get around the issue though.

5
I think the subject really says it all.

Do I need to roll this one myself, or have I overlooked the feature description?

Many thanks.

Edit - I ended up getting around this by pre-sorting my objects by alpha prior to parenting them to the UIGrid. I noticed there is a helper function called AddChild in UIGrid's documentation which offers a sorting parameter which I guess would potentially offer me the same facility with less effort, but as the version of NGUI I'm using doesn't appear to have that included, I'm loath to update due to certain risk factors - big project, late in the cycle, much potential for 'fun'.


6
NGUI 3 Support / Preferred method for showing UIButton 'Selected' state?
« on: November 19, 2014, 06:56:03 AM »

At the moment I'm kind of hacking this myself by managing states and swapping normalSprite references as required but I was just wondering whether there's a 'native' way of doing this 'properly' ?

Just to describe via application specifics: I've got a ScrollView which contains a Grid full of buttons. When I click on one button, I want it to highlight in a persistent way that demonstrates the selected state. I also want to ensure that all the other buttons in the Grid are shown as 'Unselected' when this happens.

I have other more complex scenarios which including multiple button states other than just 'on' and 'off' but I'm happy to perform my own state/viz management in those instances. It would be nice to know if there's an officially sanctioned way of doing the basic stuff is all.

Many thanks.

7
NGUI 3 Support / Changing UIPanel Depth at runtime.....
« on: August 22, 2014, 08:08:52 AM »
Can I do this? Because it doesn't seem to work.

I'm instantiating a number of prefabs as children of a reference object and a script in the parent is shuffling the order of the children via a UIPanel in each of the child objects.
Try as I might to get the priority to behave as I want to, the order dogmatically appears to stay the same.

I'm clearly overlooking something, aren't I?

TIA.

Edit - Just by way of a little more information, the child objects I'm instantiating, even when sharing the same panel depth, are prioritised in the order of the hierarchy, (so the first child is drawn above all the others) but if I detach and reconnect the objects to the parent, the priority remains the same, so it seems like they are more likely prioritised by instantiation order. Changing depth on any of the children's panels makes no difference to the draw order. I'm pretty sure I'm missing something vital here and obviously any suggestions, no matter how ludicrous would be much appreciated.


8
NGUI 3 Support / Gamepad Control of Widgets
« on: July 30, 2014, 09:41:40 AM »

I'm currently working on a game's 'frontend' that is currently in the process of a redesign and I figure that this seems like a really good point at which to get the gamepad functionality we need working before things get too scary.

Where should I start looking for technology / functionality / best practices for this task?

Many thanks.

9

I need to place label widgets one after the other in a line with each successive label positioned at the right hand side of the previous label.

As the Anchor options don't appear to be available in the 'Resize Freely' mode, is it possible to do this really simply?

Many thanks.

Pages: [1]