playMaker

Author Topic: NGUI - Combine actions of 2 buttons into 1 button[SOLVED]  (Read 2330 times)

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
NGUI - Combine actions of 2 buttons into 1 button[SOLVED]
« on: January 14, 2015, 02:10:10 PM »
So I had to redesign my UI and now am running into some problems.
I have 2 buttons that each have complicated events on down and up presses and when you press them both at the same time, it performs what I want I want perfectly.
After having to redesign my UI, it is now extremely hard to press both buttons at the same time.
So what I want to do is make a brand new button that will simulate as if I pressed both of the 2 original buttons at the same time.
Is there any easy way of going about this?
I'm using the "NGUI Events To Playmaker Fsm Events" script, and each of the 2 buttons have quite a few FSMs doing different actions for the player movement.
I'm hoping there is an easy solution where i can just have a new button simulate pressing down both of the originals.
Thanks for your time and making such an awesome package!
« Last Edit: January 15, 2015, 02:13:10 AM by jeanfabre »

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: NGUI - Combine actions of 2 buttons into 1 button
« Reply #1 on: January 14, 2015, 07:47:33 PM »
You can't just leave your other button there, with no Sprite hooked up and then use a basic Send Event to tell it to activate the behavior?

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: NGUI - Combine actions of 2 buttons into 1 button
« Reply #2 on: January 14, 2015, 08:18:12 PM »
I still need my original 2 buttons. Each of the 2 buttons makes the character jump a certain way, but if you press them both at the same time, it does a completely new kind of jump.

I had both buttons in the bottom corners so you could press them both with your thumbs at the same time. I had to move things around and put both of those buttons on the right side which makes it impossible to press them both at the same time.

There are 3 different jump types so I want to keep the original 2 buttons and have a new button simulate pressing both of the original 2.
I had an idea and tried a test where I duplicated the original 2 and overlapped them to see if I pressed it, if it would activate both buttons but it would only register pressing one of the buttons. It's kind of hard to explain all this would a picture maybe help?

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: NGUI - Combine actions of 2 buttons into 1 button
« Reply #3 on: January 14, 2015, 08:24:03 PM »
If I could get this to work with just overlapping the 2 duplicate buttons I made that would be awesome. I found that whichever button has the highest depth, is the button that gets activated when I click the space. When I set them both at the same depth, for some reason it's only allowing me to click one still and not both.

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: NGUI - Combine actions of 2 buttons into 1 button
« Reply #4 on: January 14, 2015, 08:28:06 PM »
I just found this thread and this is what I'm talking about but I want mine to activate both buttons at the same time.
I made sure the Z and depth are the same with both buttons but still only one gets pressed.

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: NGUI - Combine actions of 2 buttons into 1 button
« Reply #5 on: January 14, 2015, 08:44:50 PM »
I got it working...
Was a lot easier and faster then I thought it would be.
I just copied all the "Ngui events to playmaker FSM events" scripts to one button and copied all the FSMs to one button and linked the correct FSM target and it worked. I was over thinking and over complicating a simple problem.