cruseyd

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. cruseyd

    Dynamic Text Size

    Seems like a reasonable thing to try. I'll give this a shot. Thanks mate!
  2. cruseyd

    Dynamic Text Size

    I'm trying to implement rules text on a CCG style card object. Creating the text is fine, but I'm noticing some really bad pixelation when scaling the text up and down (I have a zoom on mouse over effect on each card to make the rules text easier to read). Is there a clean way to get the effect of a zoom while preventing (too much of) this pixelation? On a related note, I am wondering if there is a way to define a "text region" that text can be added to (loaded from a json file) and then scale the font size up or down depending on how well it fits in said region. Is there anything like this in Phaser, or would I need to code this myself from scratch?
  3. cruseyd

    Object Specific Event Handlers

    Yeah I finally got it to work as I would expect. I think I wasn't clearing my browser cache correctly or something. Thanks for the input all.
  4. cruseyd

    Object Specific Event Handlers

    Mmkay, I'm seeing that in the source code which is useful, but I can't seem to get the specific 'drop' event to fire. How does it differ from 'dragend'? Based on the source code it *looks like* a 'drop' has the semantics of a drag ending inside a valid drop zone, but I can't get it to trigger that way either (but I am able to trigger e.g. 'dragenter' which also requires a drop zone).
  5. cruseyd

    Object Specific Event Handlers

    I've noticed a pattern while rifling through the Phaser 3 example code. Events seem to nearly always be handled globally, but the scene input. For example, in the snippet below from the drop zone tutorial, the code defines a handler for a gameObject being dropped into a drop zone. But what if I have several types of game object which I want to handle being dropped differently? You could put a conditional in the global callback to check what kind of gameObject you're dealing with, or you could give all your gameObjects a callback with the same name (e.g. onDrop(args)), but I feel like there should be a much cleaner solution. Can I define all this functionality in class members for example? Sorry if I've missed something obvious; the documentation for Phaser 3 seems like it's still relatively new.
  6. cruseyd

    Tweening a Container

    Bump. I would like to know this as well. One solution that I came up with is having the container fire an event that adds a tween to all children, but that seems overly complicated.
  7. cruseyd

    Object Orientation and Events

    For the sake of anyone reading this thread later, here is the correct code in ES6 form:
  8. cruseyd

    Object Orientation and Events

    Ah I see... Is the 'click' event just deprecated or something? Is there a resource where I could have found a list of events that are valid for GameObjects? Surely this must exist, but the only API I have been able to find is this: https://photonstorm.github.io/phaser3-docs/Phaser.Events.EventEmitter.html
  9. cruseyd

    Object Orientation and Events

    I come from a C++ background, so I quite like working with classes in Javascript. I'm building a custom object, extending Phaser.GameObjects.Sprite, and trying to set up the events for it in its constructor (see attached code). The code compiles, but the even simply wont fire! What am I doing wrong?