threedollarbill

Members
  • Content Count

    37
  • Joined

  • Last visited

About threedollarbill

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Actually, i just tested 2.10.4 now and it doesn't seem to handle the audiocontext issue. I still get no sound despite clicking on the canvas.
  2. @samme: Thank you! @Phaser911: If you're still using an older version of Phaser you should..
  3. I'm currently using 2.9.4.. Looks like 2.10.3 is out. Does that version handle the audiocontext issue?
  4. Ok I was able to fix it. For anyone wondering, this is what I did: this.game.input.onDown.addOnce(() => { this.game.sound.context.resume(); });
  5. Hi, the sound on my games suddenly cannot be heard. I'm not sure what's going on. When I look at the console (Chrome), it shows a message saying "The AudioContext was not allowed to start. It must be resume (or created) after a user gesture on the page.". Does anybody have an idea of what's going on? How can I get the sounds play again?
  6. Let's say I start a tween like this: // create sprite let mySprite:Phaser.Sprite = this.create(300, 50, "my_atlas", "bee"); // tween sprite let yTween:Phaser.Tween = this.game.make.tween(mySprite); yTween.to({y: 150}, 1500, Phaser.Easing.Linear.None, false, 0, 999, true); yTween.start(); Does calling "destroy" on the sprite also destroy it's tween? Or will the tween be silently running in the background until it runs 999 times? // destroy sprite (will this also kill the tween and remove it from memory?) mySprite.destroy(true);
  7. threedollarbill

    Image Becomes Jagged When Scaled Down

    I have a transparent image which i am adding on to the stage. The original image is crisp and smooth. However, when I scale it down, it becomes jagged. I am scaling the image with imageSprite.scale.setTo(0.25390625); I've already tried the following and nothing made a difference: 1.) Set the sprite's "smoothed" property to true imageSprite.smoothed = true; 2.) Enable antialiasing new Phaser.Game(754, 690, Phaser.CANVAS, "game_container", null, false, true); 3.) Round pixels this.game.renderer.renderSession.roundPixels = true; I've attached a screenshot of what I'm seeing, and the original image if anybody wants to test it on their own. I would appreciate it if someone could give a solution for this. Thanks.
  8. threedollarbill

    Is it ok to have a lot of BitmapData?

    The client I am working for wants to be able to change how elements inside the game are colored just by just changing a variable in the code (for example "#FF0000" for red, or "#00FF00" green). So basically, what I plan to do is to just tint the sprites to whatever color on runtime, and then draw them to a BitmapData then save it in the cache so I can reuse them over and over without making it too expensive for the CPU (I've read that tinted sprites are heavy when on Phaser.CANVAS). My question is, is creating a lot of BitmapData bad? Apart from the memory that they will take up, is there anything I should be concerned about? I've read that each BitmapData is actually a new canvas. If so, does that mean a lot of BMD = a lot of new canvases = slower performance? Haha I hope I'm making sense.
  9. Is it possible to add an effect similar to Photoshop's "Bevel Emboss" on a Graphics object? Basically, I would like to draw custom shapes on the fly with an embossed look to them.
  10. I find it strange that the "onInputUp" event on a sprite still fires even if my mouse / pointer is not hovering it. Basically, I press down on a sprite, then move my mouse / pointer away before releasing it. I was expecting the "up" event not to fire but it still does. Below is the code I'm using. I'm using typescript by the way. let backButton:Phaser:Sprite = this.create(150, 150, "TA_1", "back_button"); backButton.inputEnabled = true; backButton.events.onInputDown.add(() => { console.log("pressed down"); }); backButton.events.onInputUp.add(() => { console.log("released!"); // <--- this still fires even though my pointer is not over the sprite });
  11. threedollarbill

    BitmapText linespacing?

    @samme wow thats worked! thanks for that!
  12. threedollarbill

    BitmapText linespacing?

    Is it possible to have linespacing for BitmapText? Only Text seems to have that option, but I can't do the same for BitmapText.
  13. threedollarbill

    Do draw calls matter when using CANVAS mode?

    When using WebGL mode, I know that the less spritesheets / texture atlases you use, the better the performance. In other words, the more you can pack into a single spritesheet, the less the draw calls, and thus the better the performance will be. Is it the same case for CANVAS mode? Is it still important for me to pack my as much images as I can into a single spritesheet? Or does it not matter for CANVAS?
  14. threedollarbill

    Loaded binary file never gets added to the cache? (unable to access it)

    Ahh yes, thanks for this Tom! I saw this in the examples too just now ( https://phaser.io/examples/v2/loader/load-binary-file ). I should have looked at the examples first before posting here. Thanks again.
  15. I am able to load a binary file but I cannot access it from the cache. I seem to be doing everything correctly. I am loading a zip file by doing this: let zipURL:string = Constants.HOST_BASE_PATH + "puzzles/starter_puzzle.zip"; let zipLoader:Phaser.Loader = new Phaser.Loader(this.game); zipLoader.binary("starter_puzzle", zipURL, this.onZipBinaryLoaded, this); zipLoader.start(); private onZipBinaryLoaded(cacheKey:string, binaryData:any):void { // this succeeds, and i do some processing here... } Later on in the game, I try to access that binary file from the cache, but I cannot seem to access it. I've tried the following: this.game.cache.checkBinaryKey("starter_puzzle"); // this returns false this.game.cache.getBinary("starter_puzzle"); // this returns a "not found in cache" warning I wonder what I'm missing here. I've even tried to explicitly add it to the cache, but still I am unable to access it later on. private onZipBinaryLoaded(cacheKey:string, binaryData:any):void { // here i explicitly add it to the cache do some further processing... this.game.cache.addBinary(cacheKey, binaryData); // ...do some further processing... }