themoonrat

Members
  • Content Count

    262
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by themoonrat

  1. If you want to left align it, set anchor.x to 0 instead of messing with pivot.
  2. A couple of other things... 1. Check how complex your spines are; artists love to go overboard with the cool stuff spine can do! But the more complex the Spine the slower it will be to render. When first integrating it into our libs, I asked for a very basic test spine that just had it moving from side to side, to compare performance Vs animation frames. Turns out this basic shape still accidentally contained a totally unneeded mesh! 2. Pixi v5 is able to batch meshes, so (taking a wild guess you're making a slot game!) if you have multiple of the same symbol spin through, v5 can batch those for faster rendering time when v4 can't.
  3. So I actually use https://github.com/sindresorhus/screenfull.js/ which is a great little library that handles it all for me. You also might not be able to use pointerdown within pixi as it's not always classed as a valid unlocking event that touchstart or touchend are. I use a touchend / click callback on the window to get my event to then call screenful
  4. Just like playing sound requires a user interaction to occur, so does the full screen API. So do it on a click or a touchend and it should work. Ps beware of using this on iPad. If you are in full screen and it thinks your typing on a virtual keyboard, iOS keeps displaying annoying warnings. Games usually require regularly touching the screen.... so these warnings keep coming up over and over. Thanks Apple!
  5. If you set the video src tag to be explicitly muted, you should be able to autoplay it without a user interaction.
  6. The preference should be to preload via the loader where possible.
  7. I believe that theoretically, transparent false in the renderer settings is quicker, so that's why it's the default. But in my experience, it's going to be negligible compared to any scene you're trying to render, and transparent true also helps work around occasional driver issues on older Android phones. So because of that, I'd personally always set it to true.
  8. This has nothing to do with the way you are bundling your code... it's just that your device, for whatever reason, does not support WebGL. v4 has a 'Canvas' renderer as a fallback option built in by default, but the default v5 package does not have this; you need to use the 'legacy' package instead.
  9. Does this help? https://www.pixiplayground.com/#/edit/sNKLacqLJenYpsQyc6mIp The issue you were struggling with is that Text is lazily updated. It only usally gets updated when it gets rendered; but you can force it to update with the updateText() function.
  10. First... Just move the sprite container left 10 pixels, then it's children will all move with it. Second, avoid creating functions every frame. Use a basic for loop, or create a function that's reused. But don't create a new anonymous function every frame for within a forEach. You do that everywhere and the garbage will add up quickly.
  11. PixiJS itself doesn't listen for mousewheel events at all, so I'm wondering what kind of setup you have here! It's this something you could recreate as a basic version of on www.pixiplayground.com ?
  12. https://bugs.webkit.org/show_bug.cgi?id=197689
  13. Not reported yet, bed time after a frustrating day battling this couldn't find it mentioned tho.
  14. I've come across a problem that I think is a bug in iOS / Mac safari canvas implementation, and wondering if anyone else has come across it or found any work arounds. http://moonrat.co.uk/html5/ios-text-gradient-scale/ Here are 3 implementations of the same effect in native canvas, in phaser 3 and in pixi 5. It's text with a gradient and a drop shadow, but with the text scaled down to 0.75 scale. On a desktop / android / mac / linux / anywhere, you'll see it looks correct, like: https://i.imgur.com/1qPV0r9.png But on ios the drop shadow is in the wrong place: https://i.imgur.com/bhfo6zN.png - If the scale is set to 1, then it works correctly, but anything else and it's all over the place. At first I thought it was an error I'd introduced in pixi v5, but i tried phaser 3 and it has the same issue. I then tried just using the canvas api, and it happens there too. This occurs on ios 11 and ios 12 (not tried earlier) It's crazy. I've often used lower resolution text on lower end devices for performance reasons, so this is a real killer to being able to do that. Any ideas? Or Workarounds?
  15. So, it's not strictly really based on the size to load, as both textures and audio will get decoded when loaded onto the device. Texture wise you're gonna be fine, as long as you're texture atlases are 2048x2048. Those phones do support 4096x4096 but can struggle with swapping such large ones in and out of gpu memory. But that's more of a performance at runtime issue than a 'crash' issue. So that leaves the sound. I personally wouldn't have more than a few minutes of audio on an older device, regardless of compression. Try reducing this right now for testing purposes and see if the stability increases
  16. I'll just echo what @Exca said. My experience matches; getting similar random crashes on lower end apple devices. I think it is a memory issue, either ram or on the GPU; a combination of reducing the amount of assets (textures and sounds) and reducing the resolution (textures) meant the random crashes went away. Once things got stable, I created hard set in stone asset asset limits for those older devices.
  17. You rang, m'lord? @JECKL try looking at `renderer.plugins.interaction.eventData.data.global` instead
  18. In v5, we automatically detect the max precision your device supports, and scales it back automatically too if highp is requested but not supported. If you wanted to back port this into v4, the pr with the v5 change is: https://github.com/pixijs/pixi.js/pull/5602
  19. There is no such thing as pointerover for touch. It's the equivalent of mouseover, where you hover the cursor over an area but don't select it. Touch doesn't have that. Either you've pressed it or not.
  20. Yeah, the hosting of pixi versions is down atm
  21. Yeps, thanks! We're aware; one of the reasons the v5 release has been delayed a little! Hopefully fixed soon and a new era can begin
  22. Hi all Just to let you know that we've moved examples for PixiJS version 4 to https://pixijs.io/examples-v4/ and the regular examples page at https://pixijs.io/examples/ are targeting the upcoming PixiJS version 5, using the latest APIs rather than deprecated version (`Sprite.from` rather than `Sprite.fromImage`, for example). All v5 examples are also in ES6+ now. If you land at the wrong one, don't worry, the menu on the left lets you easily switch between the 2 pages. The main point of this post; what examples would you like to see added? Is there anything you found tricky when you first started using PixiJS? Any techniques you saw posted on here that you think should get better visibility? Please let us know what you'd like to see, and we'll have a good pool of ideas to start with. And if you feel like helping us out by creating some examples for us, please go for it! Thanks
  23. I'd also say, in v5, to get the zIndex property to work, you need to set `PIXI.settings.SORTABLE_CHILDREN=true` before creating your renderer. Now the libs will automatically sorted by zIndex value on each update. But how you get those zIndex values is left up to you; I would write code that rather than does your own sorting, seeing if you could write a function that updates each objects zIndex and then see if the v5 sorting can handle it from there. Otherwise, Exca's post above is better than anything I could write on the subject!