quarks

Members
  • Content Count

    39
  • Joined

  • Last visited

About quarks

  • Rank
    Advanced Member

Recent Profile Visitors

690 profile views
  1. quarks

    Making Canvas Fill Window

    This may turn out to be more of a CSS question than a Phaser question, but what is the magic formula for making the Phaser canvas exactly fill the browser viewport without any scrollbars? I have tried using window.innerWidth and window.innerHeight and that almost works, but the canvas seems to turn out a little too big and gives me a vertical scrollbar. Even with padding: 0 and margin: 0 on everything (html, body, div, canvas) I end up with a few pixels worth of scroll. The same thing seems to happen in both Firefox and Chrome. Any suggestions?
  2. quarks

    Physics

    Can I get a quick summary of the state of the union for physics in Phaser 3? I know about Arcade, and I know that Matter.js is its own project, but what about "Impact" physics? Was that written explicitly for Phaser or did it come from somewhere else? What happened to p2 physics? Thanks.
  3. quarks

    Camera(s) in v3

    Thanks, Rich. This is just what I needed. I'll give it a study.
  4. quarks

    Camera(s) in v3

    I know official documentation is limited right now, but is there any explanation of the new camera functionality available anywhere? I am especially interested in the idea of using a second camera to do a minimap. I have looked at the examples, and I just can't quite grok how the size, position, bounds, and scale options for a camera work together.
  5. quarks

    canvas.toBlob/toDataURL as Phaser Image

    No, the canvas is inside phaser. The idea to have a hotkey for screenshots that can be displayed later. Ok, that works. It is necessary to call game.load.start() manually after queuing up the load. For reference, the code is basically this. let dataurl = game.canvas.getDataURL(); game.load.image('screenshot_' + n, dataurl); game.load.start(); I suppose doing this asynchronously makes sense given that even decoding the url might be (relatively) time consuming. But is there a synchronous way to add the data directly to the cache?
  6. How do you take the output of either canvas.toBlob or canvas.toDataURL and use it as the bitmap for a Phaser Image object? It is not clear to me which of the myriad bitmap-like type in Phaser is relevant here. Thanks.
  7. quarks

    Phaser 3 / Lazer

    Thanks for the information. No, I've been away from Phaser for a few months so I hadn't been following the newsletter. Reading through the archives I understand about Phaser CE. What about Phaser 3 vs. Lazer? I thought Lazer was Phaser 3. Are they different things now?
  8. quarks

    Phaser 3 / Lazer

    What's going on with Lazer? Did it die? Go closed source? The forum appear seems to have disappeared, and it doesn't look like the git repo has been updated in a while.
  9. quarks

    Rich Text Editor on Phaser

    I know there are a couple UI libs for Phaser, and I have seen a couple of canvas based rich text editors. Does anyone know of a rich text editor that integrates with the Phaser API? Jay
  10. quarks

    SpriteBatch

    Thank you lvasik, but I don't need to know how to use a switch/case statement. I was asking about when and how to use Phaser's SpriteBatch object.
  11. quarks

    SpriteBatch

    Can someone explain the use case(s) for a SpriteBatch and perhaps link to some sample code? The documentation is suggestive but terse.
  12. quarks

    Scrolling only part of the view

    Can anyone suggest a way to restrict the scrolling view of the world to a rectangular "window" smaller than the Phaser canvas. Think of something like viewport of spaceship with a border containing UI elements drawn around it. I know that one way to achieve this would be to mask the "space" layer with a layer (i.e. Group) with the UI elements and make it fixedToCamera. But that feels kludgy to me. As an alternative, would it be possible to put all the aliens and whatnot in space part of a fixedtoCamera "viewport" group and just scroll withinthe group? Or more to the point, is there a way to effect that scrolling without having to manually adjust the coordinates of every element within the viewport group. It seems like there should be a way to do it by adjusting the viewport origin somehow, but I'm having trouble wrapping my head around how the coordinate systems and transforms interact. Thanks.
  13. Is there any way to set the miter property for polylines drawn with a Graphics object? And is there any way to set a clipping path? I believe that Graphics is based on an html5 canvas under the hood, and the canvas api can do this. If not, is there any way to easily polyfill for these features? Thanks.
  14. I'd go with Pool. Yeah, it maybe implies a few more semantics than you're talking about including, but I don't think it's so much as to be misleading. In any event, I think that having separate objects for display grouping and logical grouping is A Good Thing.
  15. quarks

    P2: Constant movement without losing velocity

    You need to set the damping value on the body to 0. bubble1.body.damping = 0;