• Content Count

  • Joined

  • Last visited

About jmdcodejunkie

  • Rank

Contact Methods

  • Twitter
  1. jmdcodejunkie

    Conditional dragging

    I know that, but thats not conditional... I am looking more for something like, eventPointer) { if( <= 0) { //code to prevent this drag from starting... } else { // allow drag to proceed } }); if we use sprite.input.disableDrag(), then there is never another chance to check if the count is less than zero. I have to put a second check somewhere else to call sprite.input.enableDrag() before this event (onDragStart) even gets called... one common practice used that I have seen is that the event would have a propagate property or a canceled flag... or the event function would be checked to see if it returns true or false... haven't tested a return of true or false but I don't think it works that way... its common with onClick event handlers in javascript, I know that.
  2. jmdcodejunkie

    Conditional dragging

    I am trying to build a game where you are limited to a certain number of items in a stack, instead of generating the number of items, I track how many are present, and I use a spawner object that generates clones on dragStart to simulate dragging from a pile. what I want to do is if the player attempts to drag from the pile when there are no more items, then the item will tint to be darker and drag will be prevented. but I want to re-enable dragging if we drop an item into the area, thus adding to the stack. I was wondering if there was a way to prevent a drag conditionally onDragStart, or do I have to toggle drag on/off with conditionals outside of the onDragStart and onDragEnd events.
  3. jmdcodejunkie

    Anyone got custom libraries to share?

    I am about halfway through with one of my games, and I was curious if anyone else has run into this issue before... I had to implement my own menu navigation system (storing/defining displays, transitioning between them, etc) and was wondering if there was already systems out there for phaser to do this? I hope so, since phaser has been around for a while, but I can't find any at this moment. if not, then maybe I can pull mine apart and try to structure it to be a plugin for phaser... or something... I was just curious.