• Content Count

  • Joined

  • Last visited

Everything posted by Kadith

  1. I forgot to mention the other day that looks like it works in my case as well, although I've now changed my code to properly use beginPath in all the draw cases I need.
  2. I'll try and grab a copy and give it a go later today. And yeah, it would make sense that saving and restoring the context would include the path, unless for some reason they don't store the path as part of the context...which would be weird. Will keep that in mind for the future, thanks again for the help as well!
  3. At least it's something minor that I missed rather than a big issue! Thanks for the reply!! Think I had the assumption that I only needed to use beginPath if I wanted to fill a shape with a colour. I'll have to go through and update my code! Thanks again for the help!
  4. Hey everyone, I couldn't see anyone else having this issue in the forums so it might be something I'm doing but it seems that if Phaser is using a canvas element the graphics.clear function doesn't seem to work. Setting it to WebGL however does. Here's a small bit of code that replicates the issue: var config = { type: Phaser.CANVAS, //Change to WEBGL and clear works. parent: 'phaser-example', width: 800, height: 600, scene: { preload: preload, create: create, update: update } }; var game = new Phaser.Game(config); var graphics = null; function preload () { } function create () { this.input.on('pointermove', onMove); graphics = this.make.graphics({x: 0, y: 0, add: true}); } function onMove(pointer) { graphics.clear(); graphics.lineStyle(1, 0x167EFE, 1); graphics.moveTo(0,0); graphics.lineTo(pointer.worldX, pointer.worldY); graphics.moveTo(800,0); graphics.lineTo(pointer.worldX, pointer.worldY); graphics.moveTo(800,600); graphics.lineTo(pointer.worldX, pointer.worldY); graphics.moveTo(0,600); graphics.lineTo(pointer.worldX, pointer.worldY); graphics.strokePath(); } I used http://labs.phaser.io/edit.html to run it under Linux using both Chromium and Firefox, had the same issue on both browsers as well as Samsung Galaxy Tab A (in Chrome, Firefox and the default Samsung internet browser). Has anyone else seen this? Thanks, Kadith.
  5. Think I've figured out a workaround for my issue for now, seems I can assign this to a variable in the preload function and use that to access the loader afterwards. Not sure if it's a good idea but seems to work for now!
  6. Hey everyone, I'm attempting upgrade from Phaser 2.6.2 to Phaser 3.12.0 as I currently need to use SVG's for my project. However I'm having an issue since the way the load manager works seems to have changed. Previously I could call game.load.image to load an image file from pretty much any function that had access to the game variable, now it seems that this can only be done via the preload and create functions; is there a way to call this outside of those functions? The reason I need to do this is because the images I am using are dynamically generated from a server which means I don't have them until after the preload and create functions are called. Thanks, -Kadith
  7. If it's the browser then guess there's not much they can do about it (at least not easily). Checking the mousePointer directly is working great though so thanks again!
  8. Shouldn't the last event still have it registered as down in that case if the button hasn't released it? Or does that only get set when the button is pressed? Worked like a charm thanks!
  9. First time posting here so let me know if I've made any mistakes! I'm currently using Phaser 2.6.2 and am attempting to implement a panning feature using the middle mouse button. I found that when the mouseMove event is called that game.input.mousePointer.button variable is forced to be LEFT_BUTTON. I've made this small example in Phaser's sandbox. As soon as the cursor enters the stage it thinks LEFT_BUTTON is down. If you hold the middle mouse button down without moving the mouse it will register MIDDLE_BUTTON as being down until the mouse is moved again. Hopefully it's just something I'm doing wrong but if not is there anyway to get the current state of the mouse button during a mouse move other than using game.input.mousePointer.button? Thanks! -Kadith