Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by d13

  1. Hi Everyone, I'm using the SceneManager to start a scene. I then want initialise other parts of my game when the scene has started and is is ready. I've tried this (`game` is a new Phaser.Game(config)): game.scene.start("TitleScreen"); const titleScreen = game.scene.getScene("TitleScreen"); ... but titleSceen is `null`, preventing me from attaching any event listeners to it. However, if I wrap it in setTimeout and wait for 100 ms, I can access it: game.scene.start("TitleScreen"); setTimeout(event => { const titleScreen = game.scene.ge
  2. Hi Everyone, Just wondering if Phaser has an API for accessing Tiled Editor's "collection of images" data? Also, if anyone can explain how ""collection of images" is supposed to work in Tiled Editor - please do! The only information I could find on how it works is this: https://discourse.mapeditor.org/t/how-to-use-collection-of-images-tileset/2851 ... and those instructions don't work or make sense! [EDIT]: After posting a question in that thread above, it now makes sense! But is there a Phaser 3 API hook for these? Thanks!! kk.
  3. Hi Everyone! Does anyone know of a solution to this WebGL error on IE11? "WEBGL11257: WebGL content is taking too long to render on your GPU. Temporarily switching to software rendering." Should I be using the canvas renderer for IE11?
  4. There's an example here: https://github.com/kittykatattack/learningPixi#loading
  5. This was developed with Pixi v4, but should still work with 5: https://github.com/kittykatattack/tileUtilities
  6. I would love to do it! But just haven't had the time yet, unfortunately.
  7. Just for reference, I finally managed to get this working by duplicating the atlas files for as many JSON files as I have (15), giving them the same name as the JSON, and pointing the atlas to the same single PNG file. I'm getting the error message, "BaseTexture added to the cache with an id [assets/animations/observation/observation.png] that already had an entry", but I can live with that for now. If I find a better, less hacky, way to do this, I will report back 😄
  8. Thanks Ivan... just digging around my files, there doesn't seem to be a reference to the .atlas in the spine .json files. Do you mean the reference to the .png in the .atlas file?
  9. Thanks Ivan! I'm having a little trouble understanding how this might work. In this example... var atlasLoaderOption = { metadata: { imageNamePrefix: 'spineAtlas_' } }; PIXI.loader .add('flyingAnimation.json', spineLoaderOptions); .add('walkingAnimation', spineLoaderOptions); .add('anotherAnimation.json', spineLoaderOptions); ... will my JSONs need to have the same root name for them to share the single atlas and png?
  10. Hi Everyone, Another Spine question: Is it possible for many Spine animations to share one texture atlas? For example, I have some animations that look like this: animationOne.json animationTwo.json animationThree.json My atlas and PNG look like this: myAnimation.png myAtlas.png I basically need my three animations to share the same .png and .atlas files I have read this, https://github.com/pixijs/pixi-spine/blob/master/examples/reuse_texture.md, but I'm not sure whether it applies to this use case..? (If it does, please let me know!) Thank, y
  11. Hi Everyone! Another Spine question! Is it possible to set and pause the animation at a specific point in the timeline? I could find this in docs, but if anyone could point me to the correct reference, I'd greatly appreciate it. Thanks!
  12. d13

    Setting Spine skins..?

    ... I should also mention, I'm getting this warning: `"export 'spine' (imported as 'PIXI') was not found in 'pixi.js'`. But, otherwise, no other errors.
  13. d13

    Setting Spine skins..?

    Thanks! I will do some more testing and report back
  14. d13

    Setting Spine skins..?

    I'm using Pixi 5 and the have installed the pixi-spine master branch (2.1.4).
  15. d13

    Setting Spine skins..?

    ... Just to be a bit more specific, I have some slots that look like this: "slots": [ { "name": "lamp", "bone": "root", "attachment": "lamp" }, { "name": "glove_bottom", "bone": "glove", "attachment": "glove_bottom" }, { "name": "sample_skin", "bone": "sample", "attachment": "sample_skin" }, ] I'm trying to figure out how to change the skin for "sample_skin". I've tried this: this.animation.hackTextureBySlotName('sample_skin', newTexture, { width: 40, height : 40 }); ... but without luck. Is this the correct way to do it, or is there something else I'
  16. d13

    Setting Spine skins..?

    Thanks Ivan! Yes, I'm using the latest pixi-spine. I will and see if I can it working using hackTextureBySlotName (https://github.com/pixijs/pixi-spine/blob/master/examples/hack_texture.md) By the way, are the images in the spine texture atlas accessible as individual textures through Pixi's resource loader? Or will they need to be loaded separately?
  17. Hi Everyone! Just wondering what the the current practice is for setting skins in Spine? I tried the following, based on this (https://github.com/pixijs/pixi-spine/blob/master/examples/change_skin.md)... but so far it hasn't worked: this.animation.skeleton.setSkin(null); this.animation.skeleton.setSkinByName('newSkinName'); I know the skins are working, because if I change the names any of them to `default` in the JSON, they show up when the animation starts as expected. Is there something else I need to do to make sure the new skin is applied? Thanks!!
  18. Wow, thanks Ivan, using `require` worked! I would never have thought it!
  19. Hi Everyone! I'm trying to install and use the pixi-spine plugin with es6 and webpack. The docs recommend importing it like this: import * as PIXI from "pixi.js"; window.PIXI = PIXI; import "pixi-spine" But, I'm getting the error `PIXI is not defined` Any idea what I could be doing wrong? Thanks!
  20. My problem has been that the displamentFilter effect hasn't been scaling to the size of the displacementSprite, it's been scaling to the size of the entire container that the filter is added to. I'm probably doing something wrong! I will check my code and report back
  21. Ah, thanks Ivan!! I love the "Wait for you to solve it" solution So, is a demo like this not currently possible in Pixi v5 out-of-the-box? https://pixijs.io/examples/#/filters-basic/displacement-map-crawlies.js
  22. Hi Everyone! I have a general question about displacement maps in v5. I've noticed that when the displacementSprite is added to the container, the effect scales to the entire container size, rather than just being constrained to the size of the sprite. Just checking whether is the the actual current behaviour or if I might be implementing it incorrectly? I did notice this post on using bounds to constraining the size of the effect, which works, but it also masks the rest of the sprites in the container: Cheers!
  23. I don't know if Pixi's loader deals with this problem, but browsers will never actually load a font until they're requested to display it. In the past I've had to solve this problem by creating a hidden HTML element that uses the font, just so that the browser is prodded to load it. Here's code I've used in the past to fix this problem: https://github.com/kittykatattack/hexi/blob/862cb6f7773d80d7f67f7314855593f7f0e680bd/src/core.js#L415-L455 I've done tons of research on this problem in the past and this was the best solution I could find ... but this was a few years ago - hopefully
  24. Just for reference, here's my current MatterJS/Pixi render loop. The most import thing is that every of the matter body needs a reference to its matching Pixi sprite. Something like this: body.sprite =yourPixiSprite; And the Pixi sprites need their anchors set to 0.5 body.sprite.anchor.set(0.5); Then you can run this in your game loop to sync the body and sprite positions: let bodies = MATTER.Composite.allBodies(engine.world); for (let i = 0; i < bodies.length; i++) { let body = bodies; //Non-compound bodies if (body.sprite) { body
  25. I use MatterJS with Pixi, and it's great. PlanckJS is a good choice too. However... physics libraries are a potential rabbit hole. The demos you see on the library sites work flawless, but as soon as you realise you need to do something for which there isn't an example or there's no documentation, you can find yourself in a pitch-battle with the engine. The devil is in the details! So, my advice is, go as far as you can with 2D arcade collision, and only move to physics library if absolutely have to do a detailed physics simulation (like a pinball machine.)
  • Create New...