Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Hello, I'm trying to implement some retry logic for when Loader fails to load an asset. Currently I've extended the Loader class, and I'm playing around with altering the fileError method to retry downloading the same asset if it fails, but I'm not quite sure what to add here. Has anyone done anything like this before? Thanks!
  2. Hello, I was playing around with audio in my game and noticed that when I call stop() on a sound and play another one, there is still a reference to the old sound in Game.sound._sounds. Currently I am looping through and checking the keys to remove old ones when a new sound is played. Is there an ideal way to handle removing references to these old sound objects? Will this even cause any performance issues? Thanks!
  3. Hello, I am testing my game on multiple devices and I have noticed that tapping while on mobile safari does not do anything in the game. I then checked out the "click to burst" tutorial at examples.phaser.io, and tapping doesn't do anything there either. I am testing on an iPhone 4s with iOS 7. Does anyone have any thoughts on this? Thanks
  4. Hey everyone, I'm trying to use SpriteBatch for optimization, and I'm initializing it like this: spriteBatch = new Phaser.SpriteBatch(game, this); But I get the following error on that line: "Uncaught TypeError: undefined is not a function" Am I initializing the spritebatch incorrectly? I would like to avoid game.add if possible. Thanks!
  5. Awesome, loading the image from the cache worked perfectly! Thanks!
  6. Hey everyone, So I'm testing a game on IE 11 in Canvas mode and I get the following error about every other time I refresh the page: SCRIPT5022: IndexSizeError File: phaser.min.js, Line: 12, Column: 1746 The phaser code at the problem location is: this.context.drawImage(a.texture.baseTexture.source,a.texture.frame.x,a.texture.frame.y,a.texture.frame.width,a.texture.frame.height,a.anchor.x*-a.texture.frame.width,a.anchor.y*-a.texture.frame.height,a.texture.frame.width,a.texture.frame.height) Sometimes I can load up the game fine, but if I refresh I get this error. Any ideas?
  7. Hello, I am using a CDN to deliver game assets to the page, and I have CORS enabled so getting these images to load cross-domain has been working fine. However, I am drawing these images to a canvas, editing them, and then using canvas.toDataURL() to get the canvas back as an image. This all works fine, as CORS was enabled for any image drawn and therefore the canvas isn't dirty. When I try to use the resulting URL to load an image in Phaser, I get the following error: "Cross-origin image load denied by Cross-Origin Resource Sharing policy" The url for the image looks something like
  8. Hello, I am trying to combine images dynamically using the RenderTexture class, but I'm having trouble getting anything to display. Here is the code: var uiElement = new Phaser.Sprite(game, 0, 0, 'uiElement', 0);var menu = game.add.renderTexture('menu',1000, 1000);menu.render(uiElement, 200, 200); 'uiElement' is loaded at the beginning of the game. Thanks for the help!
  9. Hello, I'm wondering if I can get the pixel data at a given coordinate. In canvas, this is done through the getImageData(x,y,length,width) method, though I can't seem to find anything in Phaser to accomplish this. I only need this to be read only, and just to get the color of the pixel at that location. Anyone have any ideas? Thanks!
  10. Hello, I am using pixel art and have noticed that everything stays crisp until I call anchor.setTo(0.5,0.5) to set the center of the sprite as the anchor. The reason I am calling anchor.setTo is to flip my Sprite horizontally when I am walking backwards. Does anyone know how to avoid blurring when calling this method? Alternatively, is there a different way to flip the image horizontally without calling that method? I'm using version 1.2 of Phaser. Thanks!
  11. Hello, I am wondering if there is any way to create a blank image, and then draw other images onto it to create a bigger image. The purpose of this is to have a dynamic UI system, where our menus can be set to any size, and it will be created by tiling together all of the pieces - i.e., the top left corner is next to a repeating top middle tile followed by the top right corner, and there are as many top-middle tiles as needed to fill the width. Then it will fill out the side tiles as determined by the height. Is there a good way to accomplish this? Thanks!
  12. Awesome! Exactly what I needed, thank you.
  13. That seems reasonable, we already split out the entire head from the rest of the player, so splitting out just the hair would work. I'm using the 1.2 beta right now, is there anywhere to look for documentation on how to tint the Sprites? Thanks for the response!
  14. Hello, I am trying to create a custom Player class for my game that extends the Sprite class from Phaser, but I'm having trouble doing so. The desired outcome would be that I have access to all of the Sprite methods in this new class, but I can also add to it by adding to the prototype. Any ideas? Thanks!
  15. Hello, I am new to Phaser and I'm currently investigating whether the framework suits my projects needs. One of the requirements is that we can loop through an images pixel array (in this case, a players hair), and change the color of the pixels. Is this kind of image control available? Thanks!
  • Create New...