Author Topic: Panning UISlider with a controller  (Read 12810 times)

vivalavida

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 9
    • View Profile
Panning UISlider with a controller
« on: November 23, 2015, 05:45:41 AM »
Hi Aren,
I'm using a UISlider with just two values(On/Off),
I've set the number of steps to 2.

But when I move my joystick left and right there is a slight lag as to when the value changes,
I even tried controlling the pan with the D-pad and got the same results.
It seems to work fine if the steps are greater than 2 though.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Panning UISlider with a controller
« Reply #1 on: November 25, 2015, 05:23:26 PM »
Why use a slider that only has on/off values? Why not use a toggle?

vivalavida

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Panning UISlider with a controller
« Reply #2 on: July 05, 2016, 12:56:17 AM »
Hi Aren, finally got back to this.
I want to create a sliding toggle effect similar to this http://www.tasharen.com/forum/index.php?topic=10048.0
I don't mind using the toggle script but if possible want it to work with the pan axis of the joystick and not the select button.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Panning UISlider with a controller
« Reply #3 on: July 05, 2016, 07:45:48 PM »
That's still done using a toggle, not a slider. Toggle activates a tween or an animation that moves whatever you need.

vivalavida

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Panning UISlider with a controller
« Reply #4 on: July 05, 2016, 11:39:03 PM »
how do i control the toggle with the pan axis of the controller?
edit: was a stupid question, will use OnPan.
does OnPan provide direction ie positive or negative?
edit edit: ofcourse it does.. if any one else need it use , OnPan (Vector2 delta) and then delta.x or delta.y for x and y axes
« Last Edit: July 06, 2016, 12:09:40 AM by vivalavida »