Author Topic: a suggested tweek for NGUI  (Read 2874 times)

Bernard Parsons

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
a suggested tweek for NGUI
« on: March 27, 2014, 08:31:16 AM »
I've managed to get very familiar with NGUI and I love it, but during my designing phase in setting up the complex UI I'm creating I found that I keep needing one little function that I thought I would suggest. I'm sure adding more toggles and such might fix this, but trust me when I say I am creating some complex shit here... I am.

The issue I'm having is to force all button function to react to that one call function (if I'm using the proper term). I have three buttons stacked on top of each other that when clicked opens a drop down panel for each using the toggled script to activate the "Tween Position", the "Tween Height" and in some cases I also use the "Toggle component" and "Toggle object" to completely hid everything. Objects with button or scrolling that are laid on top of each other conflict, so hiding them completely fixed this issue.

Now depending on the combination, I run into an issue where clicking on one of the buttons will cause the other button features to overlap. I've tried everything so I'm getting our programmer to fix this. But the reason I'm bringing this up as a small feature to add, it's just that I come across the same issue with other UI buttons that do allot of "do this if you do that" or "if you do that and that then do this", after a while the poor button just starts clogging up with toggles and it's like a combination lock that eventually get confused and doesn't work properly. Hope you understand my analogy here.

So what I'm trying to say is... if there was a parameter in one of the toggles that allowed you to tell all functions within an assigned group to tell everyone when clicked "I want all of you to do this". Example: I have multiple floating panels that is a part of my UI, each one has a button that when clicked will hid the panel. This is to allow the user to decide what UI to have available on the screen. In the top left corner is a button that is supposed to toggle all of them depending on their state, hidden or not hidden. If I click this button in the top corner to hide all but one of the panels is already hidden, it will pop out from the side and the other panels will hide (sliding to the side out of camera view). If I could tell all UI panels that if I click this button I want all of you to hide and if I click it again, to open and show the UI, then all should show, not causing them to toggle depending whether they are already hidden or not.

This would also apply itself to the drop down menu issue I'm having. I want specific drop downs to appear and close depending on its state and when you have several of them telling each other what to do, it gets very confusing or I just can't figure out why I can't get it to do what I want it to do.

If I could provide video capture I would post it, but for now I'll just add images to look at. If you need more explaining, I'll do my best to send better documentation.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: a suggested tweek for NGUI
« Reply #1 on: March 28, 2014, 12:37:50 AM »
I'm not sure why you are doing this using a toggle... I'd just do it using regular buttons that trigger a tween to play in a specific direction. And in general when dealing with multiple windows it makes sense to create a manager script that would be aware of all the windows, and to trigger functions inside, such as "OpenSidePanel()", and inside this function would be all the logic that would hide whatever needs to be hidden for the side panel to open.

Rigging it all via inspector without any code is certainly possible, but can get tedious fast.

Bernard Parsons

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: a suggested tweek for NGUI
« Reply #2 on: March 31, 2014, 03:17:44 PM »
Hey there,
thanks for getting back to me on this.

I will experiment a bit using the play tween instead. At the beginning when I first started using NGUI I thought this was the way to do it. As for the manager script, great idea. But I think our programmer is implementing it into the actual toggle script. It will have a parameter where we drop a special scrip that will do this for us, allowing me the designer to specify what groups of tweens can be affected.

If it turns out that this will work, I'll let you.