• Content Count

  • Joined

  • Last visited

Everything posted by mattbrand

  1. That is exactly it. Thank you again @samme!
  2. I made some serious progress with help from @samme. Still not sure what to do in onDragUpdate(), where I catch the case where I want to have the ball be released: if (xDiff > 20.0 || yDiff > 20.0) But I don't know what to do there in order to disable the ball and re-enable it. You can see my attempts, commented out there. Anyone have suggestions for how to "let go" of the ball right there, but still have the ball be enabled for input events and drag?
  3. I am making a maze game where the player drags their finger to control a ball moving through a maze. I would love to use Phaser physics to block the ball from moving through the walls. Is there a way to do this with Phaser physics and if so, which physics type would be the best suited for this?
  4. I read that as well. I am using 24px. But I am scaling, so perhaps when it scales really small on mobile that's when it gets weird.
  5. In my game I have a form that I built with Orange Games' input plugin ( The input form working great on computer, but on mobile when you tap into an input field, it zooms in, and becomes impossible to see what you're doing, or go to the next field. I tried using scale prevention with meta tags: <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"> and: <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=2, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> but my game uses "game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL" to look good on all resolutions. So when I put in the meta tags, it doesn't scale initially, and it is too big on mobile. Is there any way to use a meta tag that allows for initial scaling on mobile, but then freezes the scale in order to prevent zooming on input fields?
  6. Never mind, figured it out. Had to do with how I was detecting a tap, because a tap was a special action that deleted a selection. I was doing it badly, and it was messing up the accuracy of inputover detection.
  7. A game I made that is playable here: Has the input events defined as such:, this);, this);, this); On a computer it works great. On a touch device, there seems to be a lack of sensitivity. So sometimes if you tap and move your finger, it doesn't register a touch at all. Sometimes it will register the first touch, but not pick up the onInputOver on the next tile. Any ideas why this would not be accurate on touch?
  8. Hey all! I am trying to use a custom cursor in my game. It works at first, but when I roll over a Phaser button (in latest Chrome and latest Safari), it switches back to the regular hand cursor. I have tried setting the cursor through CSS: canvas { cursor: url('./assets/images/hand_blue.png'), auto; } And Phaser: = "url(assets/images/hand_blue.png), auto"; It fails using both methods, when the input goes over a Phaser button. Any thoughts on this?
  9. Hey all! I add a music track that I want to loop using this code: music = new Phaser.Sound(game, "music", 1, true); It loops correctly everywhere except on IE. Has anyone has this issue? Is the work-around to have an event fire on sound complete?
  10. This is still an issue with Edge 14. Thanks @st0n3vn I put your alternative into place!
  11. OK that's great advice, thank you. I have a license for TexturePacker, which works really well. It has a default template for Phaser.
  12. "WebGL: INVALID_VALUE: texImage2D: width or height out of range" I'm actually creating a texture atlas with all the frames now, as I learned that spritesheets are not very efficient.
  13. Is there a maximum image width or height for images imported with game.load.image on mobile? I have a sprite sheet that is 3080 pixels wide, and I think it may be the culprit of an error that is happening.
  14. The default setup for buttons in Phaser is that if you click on a button, then move the mouse (or finger on mobile) off the button, when you let go it still registers as a click/tap. Is there a way to have Phaser buttons perform like most buttons - where if you move the input off the button before you release, it does not activate the button?
  15. How do you vertically align text in the center? I have a high score box that shows 5 scores listed vertically. I render the names using a dynamic font size - so depending on how wide the name is, the font size is bigger or smaller. You can see in the attachment that if the name is very long with a very small font, the name looks like it is vertically aligned to the top. I want the text to be vertically centered. I tried using boundsAlignV in the style of the font, but that didn't change anything: var style = {font: "64px Knewave", fill: "#ffffff", boundsAlignH: "center", boundsAlignV: "center"}; Any other ideas?
  16. Oh, I am on 2.4.6! Thanks for the info!
  17. Hey all! I have 4 game states - Splash, Tutorial, Play and GameOver. Splash and Tutorial load and render quickly, but when I go to Play, it takes a second, and it shows a black screen during that second. I want to have a more elegant state transition. So I started looking around and see lots of suggestions, which all focus on and But I can't seem to use those functions. When I try to use them in create for the any state I get "Typeerror: is not a function(…)", and same for flash. I've also tried What am I doing wrong?
  18. Ah, I figured it out. I have to scale the crop rect by the inverse scale: cropRect = new Phaser.Rectangle(0, 0, meter.width / scale.x, meter.height / scale.y);
  19. @samme I realized why mine doesn't work, using the same exact code. I have my sprite scaled (I'm making a game that uses 3 different resolution scales). When I scale the original sprite, the crop rect gets weird. I can't seem to get the shape correct. When I use this code: meter = game.add.sprite(50, 50, "meterFill"); meter.origPosition = meter.position.clone(); cropRect = new Phaser.Rectangle(0, 0, meter.width, meter.height); meter.crop(cropRect); cropRect.x = 50; meter.x = meter.origPosition.x + cropRect.x; meter.updateCrop(); It correctly shows like the first screen shot. But if I add this line: meter.scale.setTo(scale.x, scale.y); It shows up way too small (not the proper scale), and also does not show the right edge of the sprite properly. It looks rectangular. See screen shot #2.