in mono

  • Content count

  • Joined

  • Last visited

About in mono

  • Rank
    Advanced Member
  • Birthday 09/11/1991

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

919 profile views
  1. Phaser Examples - loading files without states

    Maybe you should refer to instead of just game. Phaser examples do use states, you just can't change them.
  2. Is there a code for diagonal dragging?

    I had a similar problem in a company I worked for before. We ended up doing it manually - not relying on Phaser's drag functionality but rather using tweens to update the object after some calculations are done.
  3. Moving the Clock Minute and Hour Hand

    I guess you should simply move the hour hand by half a degree for each passed minute. 360 degrees in the whole circle, 30 degrees for each hour (360/12), 0.5 degrees for each minute (30/60) as far as the hour hand is concerned.
  4. Creating multiple popups with too many functions?

    Reuse the code and just pass what's different as a parameter. Better yet, make a class for the popups, write the open and close methods for it, then work with instances of that class.
  5. GUI suggestion for desktop version

    I'd add that you might take a look at Photoshop's "scrubby zoom". Basically what it does is that it allows you to zoom in and out by click and drag right/left while using the Zoom tool, but that would require an implementation of some sort of tools in your app and I don't know whether you've done that or whether you intend to do it.
  6. GUI suggestion for desktop version

    Mouse and modifier keys. Just look at apps meant to be used primarily with mouse and keyboard, i.e. AutoCad, Photoshop.
  7. An anchor is set in fractions, i.e. (1, 1) is the bottom right corner and (0.5, 0.5) is the middle (no matter how big the sprite actually is), whereas a pivot is in pixels (thus different for each sprite).
  8. while on array unexpected behavior

    Just swap the increment step with the next line.
  9. get state

    It's not "too much info", it's just the whole state object. If you're looking just for an identifier, try this: game.state.getCurrentState().key It will give you the key you used to add the state to the state manager.
  10. Problem with world.scale.set() and angleToPointer()

    Yup, I got it now. Maybe the more "correct" approach would be to play with the camera, not with the world (as seen from the other topic this introduces other problems), but this is just what I would try.
  11. Problem with world.scale.set() and angleToPointer()

    Yes, exactly. Any .set() you do on a Phaser.Point with only one argument, it applies that argument to both x and y. It's unlikely that they'd be different, just thought I'd mention it. By the way, if you don't mind me asking, what's your aim with scaling the whole world? What are you trying to achieve?
  12. Problem with world.scale.set() and angleToPointer()

    Just played with it and apparently you have to also scale the input. As weird as it is, you don't need the same scale, but the reciprocal of it. game.input.scale.set(1 / 1.35); P.S. Call this just after setting the world's scale. P.S.2 This assumes you have "square" scaling, i.e. scale.x === scale.y
  13. Maybe do it like this: class BaseGame extends Phaser.Game { constructor(width?: number | string, height?: number | string, renderer?: number, parent?: any) { super(width, height, renderer, parent); this.state.add("Main", MainState, true); } } class MainState extends Phaser.State { preload(): void { } create(): void { } update(): void { } doStuff(): void { } } window.onload = () => { let game = new BaseGame(400, 490, Phaser.AUTO, 'content'); } This way you won't have to hold a separate reference to the instance of Phaser.Game (BaseGame itself will be it). In the same line of thought MainState extends Phaser.State, so you don't have to explicitly define an object like you did. Of course, split this into files (each class in its own, plus the window.onload in a third one, maybe App.ts depending on your project structure).
  14. Preferred Language for Phaser?

    Started off with JavaScript a few years ago when ES6 was still a no-go. Moved to TypeScript a few months later and haven't looked back.
  15. load assets after preload

    You can try something like this: let imagesToLoad = ['image1.png', 'image2.png', 'image3.png'];;; ... but because (naturally) the images won't load immediately, you have to attach a callback and wait for the loading to complete like this:, this); and then do your stuff in a method called 'loadCompleted' in the same state. Haven't tested it, but it should work. Edit: maybe you should attach the callback twice (once before and once after) if you want to try adding stuff to the load queue right after preload(). If something is already loading, the error is probably because you're calling start() when the loader is still running.