playMaker

Author Topic: Dividing the Screen into Two "Buttons"  (Read 3641 times)

Shirts

  • Playmaker Newbie
  • *
  • Posts: 2
Dividing the Screen into Two "Buttons"
« on: March 22, 2014, 03:51:39 AM »
I'm trying to divide the screen into two invisible multitouch "buttons". I want Side A to perform ActionA and Side B to perform ActionB.

And also they need to be pressed simultaneously if need be so ActionA and ActionB can trigger at the same time.

If anyone can point me in the right direction, I will send you a candy bar. =)


Graham

  • Sr. Member
  • ****
  • Posts: 340
  • I Love Playmaker!
    • Portfolio
Re: Dividing the Screen into Two "Buttons"
« Reply #1 on: March 28, 2014, 09:20:24 PM »
You could use a guitexture, one to cover each side, once they are in place simply set the texture to "none" to make them invisible. Once this is set up, give each one a "Touch Gui Event" action, and set the "touch began" event to trigger whatever state you need.
More templates on the Unity Asset Store!

Disclosure: We are using affiliate links to our assets; we may receive a commission for purchases made through them. This helps us to continue developing and maintaining great products!

Neoisrael

  • Playmaker Newbie
  • *
  • Posts: 34
Re: Dividing the Screen into Two "Buttons"
« Reply #2 on: April 08, 2014, 08:45:14 PM »
If i were u i would set the touch screen to detect where the touch happened, as u know the screen is devided, so 0.5 on x and 0.5 on y is the ezect middle, if i would to do this i would set that when touch on x axis > 0.5 do actionA  when touch on x axis < do actionB

And if u want them to be clicked togther u will have to set a seperate fsm for each one of the sides that will send a bool change and if the 2 bools are true do the combined action

Hope this helped