playMaker

Author Topic: Limit movement of touch button control in circle? {SOLVED}  (Read 2357 times)

san_san

  • Playmaker Newbie
  • *
  • Posts: 27
Limit movement of touch button control in circle? {SOLVED}
« on: July 26, 2016, 12:21:10 PM »
Can't find it in the forum, probably someone help me with solution, it must be simple.

I have setup touch movement control for mobile game on android but can't figure out how to limit movement of this Button in Circle on the screen.

So far i only setup to limit it in X and Y axis but this is not a correct thing.
« Last Edit: August 05, 2016, 03:50:40 AM by san_san »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Limit movement of touch button control in circle?
« Reply #1 on: July 27, 2016, 06:10:51 AM »
Hi,
I don't know what you mean, can you show some pictures / videos?

san_san

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Limit movement of touch button control in circle?
« Reply #2 on: July 27, 2016, 06:39:23 AM »
Hi,
Thanks for reply, video - Can't figure out how to limit, this white control button in some circle, as it usually work in mobile games.
« Last Edit: July 27, 2016, 06:42:07 AM by san_san »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Limit movement of touch button control in circle?
« Reply #3 on: July 28, 2016, 06:33:28 AM »
Hi,
You could try with float clamp actions to limit the range.

san_san

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Limit movement of touch button control in circle?
« Reply #4 on: July 28, 2016, 07:27:54 AM »
Yes it works but in square(Y\X axis), when i need a Circle like it usually in mobile games.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Limit movement of touch button control in circle?
« Reply #5 on: July 28, 2016, 08:45:51 AM »
Hi,

For this, i solved it by having an invisible touch area that the actual button follow, and i clamp the position magnitude which then constraint it into a circle.

check out "uguiJoysticj" on the Ecosystem, there is a fully working sample for this.

Bye

Jean

san_san

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Limit movement of touch button control in circle?
« Reply #6 on: August 02, 2016, 09:08:41 AM »
Thanks, it's works for me.
"invisible touch area" - i setup it using touch object but if i change aspect ratio they divergent, so move button not working.

Do you somehow adjust scree scale for both UI and Touch object or use only UI?
Invisible UI must have Ondrag callback option in Playmaker Ugui Compoment?

san_san

  • Playmaker Newbie
  • *
  • Posts: 27
Re: Limit movement of touch button control in circle?
« Reply #7 on: August 05, 2016, 03:50:07 AM »
Solved
Use Playmaker Pointer u Gui - function on pointer enter
Place them on invisible buttons - Aplha - 0