d13

Members
  • Content Count

    554
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by d13

  1. 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.
  2. 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?
  3. There's an example here: https://github.com/kittykatattack/learningPixi#loading
  4. This was developed with Pixi v4, but should still work with 5: https://github.com/kittykatattack/tileUtilities
  5. I would love to do it! But just haven't had the time yet, unfortunately.
  6. 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 😄
  7. 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?
  8. 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?
  9. 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, you!
  10. 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!
  11. 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.
  12. d13

    Setting Spine skins..?

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

    Setting Spine skins..?

    I'm using Pixi 5 and the have installed the pixi-spine master branch (2.1.4).
  14. 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'm missing?
  15. 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?
  16. 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!!
  17. Wow, thanks Ivan, using `require` worked! I would never have thought it!
  18. 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!
  19. 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
  20. 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
  21. 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!
  22. 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 there's a better solution out there.. ?
  23. 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.sprite.x = body.position.x; body.sprite.y = body.position.y; body.sprite.rotation = body.angle; } else { //Compound bodies (In MatterJS compound bodies can only be one level deep, so no need for recursion) if (body.parts.length > 1) { for (let j = 0; j < body.parts.length; j++) { let childBody = body.parts[j]; if (childBody.sprite) { childBody.sprite.x = childBody.position.x; childBody.sprite.y = childBody.position.y; childBody.sprite.rotation = childBody.parent.angle ; //Or, I'm not sure if this last line might be more correct - I'm still testing: //childBody.sprite.rotation = childBody.parent.angle + childBody.angle; } } } }
  24. 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.)
  25. Thanks Ivan!! I will check out those updated references. I've used my own sound library in the past, which has worked will with Pixi in the past. I used Pixi's loader to load the sounds then, then my library to decode them (https://github.com/kittykatattack/sound.js/issues/8) I've never used pixi-sound.. how stable is it? If it works well on ie11 I might consider it but it seems like there are some issues.