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

Pages: [1] 2
1
Ah okay, that makes sense.

I was advised by the project lead not to use the API updater, so I didn't.

I guess I'm lucky that there weren't more issues. :)

Many thanks for the replies.

2
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.

3
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.


4

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.



5
NGUI 3 Support / Re: NGUI is great.... almost
« on: May 05, 2015, 08:34:03 AM »
Thanks Aren,

We're right at the end of a project so I'm not sure that making the necessary update just for this feature is going to fly, but thanks for the headsup in any case.

6
NGUI 3 Support / Re: NGUI is great.... almost
« on: May 01, 2015, 11:17:14 AM »

Did this one ever get added?

"Ability to change caret position via mouse click events"

It's just that I've had a request to make that happen.... :/

Thanks in advance.

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

8
That's good to know for next time ArenMook.

Thanks for the reply.

9
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'.


10

I appreciate that, ArenMook as I am using pad input when the context is appropriate, but when in pure mouse control mode, I sometimes want to click on a button in a grid and what that stay highlighted to show a 'selected' state.

If I then click on another button in the grid, I'd like the same thing to happen to the new button while the previous button reverts to 'unhighlighted'.

As I say, right now, I'm maintaining the states myself and OnClick() altering the sprite and button's normalColor to suit. I generally follow this by forcing a OnHover(false) which refreshes the visual state of the button with my new color.

As I say, this is a hack. It works, but as this seems to me to be a behaviour that probably gets used a lot, I was wondering whether there is native support for it?

11
NGUI 3 Support / Re: How to know a UITween is playing?
« on: November 19, 2014, 09:00:23 AM »
Can you just check the enabled Boolean on the component?

Do they not just disable themselves when complete?

12
NGUI 3 Support / Re: Hiding sprites without active = false
« on: November 19, 2014, 07:26:16 AM »
Does disabling the UISprite component give you what you need?

I'm guessing it probably does.

So why the doubt?  ;)

13
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.

14
NGUI 3 Support / Re: Changing UIPanel Depth at runtime.....
« on: August 25, 2014, 11:28:47 AM »
I am aware that this is the expected behaviour and I've seen myself that such simple setups exhibit this behaviour without issue.

Which is why I felt I had to ask whether there might be a situation where this expected behaviour would fail.

I guess I'll have to gradually reduce the simplicity of the hierarchy until it works as there is clearly something throwing a spanner in the works here.

Found It - It just goes to show that you should never presume how things work........... a UIPanel as an immediate child of a UIPanel, the children of which contain the visible widgets, appears to effectively the top-level UIPanel's Depth property redundant. I removed the explicit UIPanels from the top-level objects and applied my depth values to the child's UIPanel and everything is now cool. :)

15
NGUI 3 Support / Re: Colliders and Alpha
« on: August 22, 2014, 08:30:35 AM »

Yeah I had this too in a UIButton where I needed to make the UISprite disappear on rollover.
So I just gave the rollover colour an alpha of zero to clear it because that was the most direct way of doing it.
Unfortunately, this meant I was then unable to click the button once I'd rolled over it because there was effectively no graphical representation there and that appeared to defeat the process.
So I just set the alpha to 1/255 which was near transparent enough to be imperceptible.

Pages: [1] 2