Jump to content


  • Content Count

  • Joined

  • Last visited

About gcardozo

  • Rank

Contact Methods

  • Twitter

Recent Profile Visitors

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

  1. I created this post in 2017, I remember I've ended up using Phaser instead of pure PixiJS. But as you guys mentioned, it's just a matter of adding the TypeScript typings and everything works fine. I remember back in 2017 I've had some auto-completion issues with VS Code, but I played a little bit with the same stack (TS, Webpack and PixiJS) recently and everything worked out of the box beautifully. Thanks for your answers anyway! :)
  2. @agonya are you using atlases? It may improve your game's performance. Tutorial: https://www.codeandweb.com/texturepacker/tutorials/creating-spritesheets-for-phaser-with-texturepacker
  3. @samid737 do you know how much memory is usually saved by combining all audios into one audio sprite instead of using several Phaser.Sound?
  4. @samme is there any work around to improve it?
  5. Hi, I have a folder with 23MB of sounds (including music), all of them are in .ogg format because I need to support really old browsers. When loading those sounds, memory usage goes up to 900MB. If I comment the lines below, it stays about 90MB. What am I doing wrong? Controller.numMusic = 5; //Load music: for (var i = 0; i < Controller.numMusic; i++) { let soundName:string = "music" + i; this.game.load.audio(soundName, "assets/audios/music/" + soundName + ".ogg"); } this.game.
  6. I'm trying to crop a Phaser.Text, so I can make something similar to the As3 TextField class (where your text is inside of a mask). But the crop method is not working, here is what I did: this.pText = new Phaser.Text(this.game, 0, 0, text, style); this.pText.crop(new Phaser.Rectangle(0, 0, 20, 20), true); this.pText.updateCrop();
  7. Hi, when I create an empty image, I always get a 32x32 pixels image. //As you can see, I'm not passing any 'key' this.img = this.game.add.image(x, y); Then, even after adding a rectangle to my Phaser.Image, its size is still 32x32. this.rect = new Phaser.Graphics(game); this.rect.beginFill(color, alpha); this.rect.drawRect(0, 0, 200, 100); this.rect.endFill(); this.img.addChild(this.rect); And if I manually set the image width and height properties, it would scale the image children. So, how can I create an empty Phaser.Image of a specific size? Edit: I'm not
  8. @flyovergames that's exactly what I was looking for, thank you!
  9. Hi, Phaser devs! I'm developing a game using Phaser with TypeScript and what I'm trying to achieve is this: var component:AwesomeComponent = actor.getComponent<AwesomeComponent>(); I know there's a workaround by constructing objects of type T. But I don't like it because I'd probably need to define tons of different constructors to represent all differents kinds of components. What I'm doing so far is passing a string with the type (of course a number would be better, but I'm still prototyping): getComponent<T>(componentType:string): T { for (let i = 0; i &l
  10. Hi, Is your tileset "tmw_desert_spacing" and tilemap JSON inside the same folder? Because in your tilemap property "tilesets", looks like it's expecting to be in the same folder: "image":"tmw_desert_spacing.png", I didn't understand what you're trying to achieve here: sid = map.tiles[tile.index][2]; set = map.tilesets[sid]; map.tiles returns the property "tiles" from your tilemap json, and I didn't see any "tiles" property there. If your're trying to get an specific tile, you can do it using: var tile = map.getTile(x, y, layer, true);
  11. Hi, I'm quite new to web development, so I'm quite lost regarding to make VS Code Intellisense work for PixiJS. I'm currently using Webpack 2 and I'm able to run PixiJS examples, but only because I've included this in my index.html file: <script type="text/javascript" src="libs/pixi.min.js"></script> So, my code works, but I don't get any autocomplete in VS Code because I don't know how to import Pixi classes and methods into my .js project files. Can someone give me pointers or a small tutorial about that? Thanks a lot
  • Create New...