nkholski Posted January 11, 2016 Share Posted January 11, 2016 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 More sharing options...
rich Posted January 11, 2016 Share Posted January 11, 2016 Nope, the DPad is 4-way only. For 8-way I would use a standard Stick and then check the coordinates the stick is within, mapping that to one of the 8 segments. Link to comment Share on other sites More sharing options...
tsphillips Posted January 28, 2016 Share Posted January 28, 2016 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 More sharing options...
nkholski Posted February 1, 2016 Author Share Posted February 1, 2016 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 More sharing options...
Recommended Posts