Jump to content

Virtual Joystick Plugin: Dpad diagonals?


nkholski
 Share

Recommended Posts

Is it possible to get diagonal values or preferably multiple directional values ({up: true, right: true, down: false...}) from the Dpad without modifying the plugin? I use "stick.direction" now, but it's limited to one value of Phaser.LEFT, Phaser.RIGHT, Phaser.UP or Phaser.DOWN.

Link to comment
Share on other sites

  • 3 weeks later...

What about stick.octant?  For me it is returning Math.floor(angle / 45) (with the angle counterintuitively going clockwise), or one of eight different directions.

Edit: There seems to be a bug.  Sometimes it is 0, sometimes it is 360.  So, there are 9 different possible values for stick.octant.

Tom

 

Link to comment
Share on other sites

I ended up modifying the plugin. The analog stick centers itself, requires drag and I preferred the visual presentation of the dpad for this project.

I used it in this Metroid remake project to be able to aim up while running:

metroid.niklasberg.se

@rich: if you're interested I could try to find time to make my solution less hacky and send it to you for review. 

@tsphillips: didn't see your post until now so I never really get around to try it.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...