Author Topic: I need some help to create a toggle able curtain menu in NGUI  (Read 4407 times)

Public D

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
HI. I'm in a small group of game developers curretnly working on our first title. I'm one of the artists for the game and have no experience with programming or unity or NGUI at all, but I have been assigned to make the menus for the game.
I'm trying to create a menu that looks like four buttons. Let's call the main directory buttons (1).
When you press on 1, a window (2) is supposed to glide out from under the start button and three smaller buttons (3) is supposed to slide down from under 2.
I've included a picture to better explain what I'm after.
When you press another of the buttons in the same row as 1, The same thing should happen to that button but the 2 and 3 buttons from the former button is supposed to glide back into their original positions so that only one 1 button has their 2 and 3 buttons out at any given time.

As I said I have no experience whatso ever in this so I would appreciate as simple solutions and answers as possible.
Thanks for any help possible

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: I need some help to create a toggle able curtain menu in NGUI
« Reply #1 on: April 09, 2014, 03:05:33 AM »
UIToggle component lets you have a group of toggles that behave like radio buttons (just specify the same group ID). This will ensure that only one can be "on" at any time.

Set up your sub-button animations either via the animation, or just by using tweens.

Attach UIPlayAnimation or UIPlayTween with "OnActivate" trigger to the same object as your toggles. Choose the Tween Target to be the appropriate tween that will animate that button's sub-button.

That's pretty much it. I strongly advise you watching the tutorial videos for NGUI, they cover how to use tweens.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: I need some help to create a toggle able curtain menu in NGUI
« Reply #2 on: April 09, 2014, 06:37:18 AM »
Contextual in the asset store is very good for this.

Public D

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: I need some help to create a toggle able curtain menu in NGUI
« Reply #3 on: April 10, 2014, 08:21:38 AM »
Thank you for the help. The problem I've encountered is that the script Uitoggle.cs doesn't exist.
I've searched the web for a source to download it or see it so that I can make my own. But I haven't found anything fruitful.

Is there another way to get the same result by using another kind of method?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: I need some help to create a toggle able curtain menu in NGUI
« Reply #4 on: April 10, 2014, 08:24:57 AM »
If it doesn't exist then you are using an old version of NGUI. If you're using NGUI 2, remember that it's free and doesn't come with support.

Public D

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: I need some help to create a toggle able curtain menu in NGUI
« Reply #5 on: April 10, 2014, 09:36:52 AM »
Yes. It appears that I'm working in 2.6.4 version.
I have researched a bit more and It seems like I should be able to create a simillar result by using checkbox and Uibutton play animation. However I'm having some problems with the check animation box.
Just using checkbox causes the sprite I want to move to dissapear. But according to the explaination of the script here http://www.tasharen.com/?page_id=880 I'm supposedly able to change it into other events too.

So my question is really. How do I create an animation that I can choose from the check animation. It shows no examples

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: I need some help to create a toggle able curtain menu in NGUI
« Reply #6 on: April 11, 2014, 06:52:08 AM »
As I said, NGUI 2 is not supported. Hasn't been in a long time now. You need to update to NGUI 3.