themoonrat

Members
  • Content Count

    293
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by themoonrat

  1. Timing is never a browsers strong point 😕 One option is to have, say, 3 pieces of music, all the same length, all set to loop, all set to start playing at the same time. But you change the volume of them to say, bring one bit of music whilst another fades out. Think of it like layering instruments in an orchestra.
  2. I'm sorry you don't like the solutions, but it's not something that's really come up before that people haven't been satisfied covering with the existing methods. There is nothing more we can give here.
  3. From the comments... if you didn't want any move events in your game, then that is a reasonable way to do it. There's no simpler way either at a top level or on a per component level. It's that or digging into overriding functions, like Ivan suggests above, so that if the event is a move event, it's ignored if the component contains a flag or something
  4. The reason the hitArea helps is because it uses that instead of searching through children to find the hittable areas. So if you require interactivity, hitAreas are the way to go. I'm not sure why this wasn't acceptable in your opening post? What issue were you having with them? They work on all events. In any case, for really complex scenes, what you could do is have an extra layer, where you put either transparent sprites, graphics or containers with their own hitarea - which are purely for hit areas for the scene below? So instead of stage --> armatureDisplay you have stage --> interactivity layer --> armatureDisplay Nothing below interactivity layer is actually interactive... just items in the layer above, which consist of very simple objects which mirror the size and shape of what is below.
  5. If you could put a little demo on https://www.pixiplayground.com/#/edit we could take a look for you
  6. There is a setting to enable this for all containers by default if you wish https://pixijs.download/dev/docs/PIXI.settings.html#.SORTABLE_CHILDREN
  7. themoonrat

    Yoreni

    What you're looking for is a mask https://pixijs.io/examples/#/masks/graphics.js
  8. I find that a video needs to be played for seeking to work in updating the video being watched. So try seeking, then a play, then a pause again.
  9. The reality is, everywhere supports 4096x4096. But! If, during your app, a texture is required to be rendered from an atlas not yet in the GPU memory, then a 4096x4096 texture is going to take longer to upload to it, and, in my experience, cause a micro stutter in the app on older mobile devices. So I used 2048x2048. Not quite as efficient as more atlases required.. but texture swapping doesn't effect gameplay. Now, depending on your app, that may or may not be a problem for you! You might be able to guarantee all base textures are uploaded to GPU using prepare plugin before being used, or you might only be targeting desktop, or might not have many textures so no multi-texture swapping is required.
  10. Yep, PixiJS is made for the normal browser environment... so anything outside that is out of the project scope. But there polyfills out there and a few specific pixi projects to enable it to work elsewhere
  11. When you're not using a preloader... the width is 1 until the image had been loaded. We can't know the true width of something if it's not been loaded yet. When it has, an event on the texture is fired and the true value can be known. If using a loader, then it'll give you the references to things it loads which you can pass in elsewhere. The built in loader will add textures loaded into PIXI.utils.TextureCache that you can reference from anywhere.
  12. I believe the prepare plugin, to upload textures to the GPU, also uses the system ticker, to try and not flood the GPU with tons of uploads all in 1 frame
  13. In the event data, there is a flag called 'isPrimary'. So you could ignore events where that isn't true to effectively disable multi touch? https://pixijs.download/dev/docs/PIXI.interaction.InteractionData.html
  14. For your first request, it can be achieved by creating a Blur filter on the text. Now tween the strength of the blur whilst also tweening the alpha for the text, and you should have the effect you require. For the latter: do you have an example that you could show please to help visualise the effect?
  15. Correct. Animations and such should always be based on time rather than frames to ensure things occur at a consistent speed regardless of fps. You'll often see 'delta' used in rendering engines. Some have delta as 'the amount of time passed since the last time an update occurred' and some have it as a number which has '1' running at normal speed, and '2' meaning the engine is running at half the fps. Then you can multiply the delta by your movement amount and voila.
  16. Unfortunately this is the limitation of using the Canvas API to draw text onto a canvas, which then becomes the texture for a Sprite. https://github.com/Mwni/PIXI.TextInput Isn't what you need, but was one persons way of mixing Pixi and the DOM together
  17. I'd just call destroy As part of the DisplayObject's destroy function, it has the following code, that removes itself from any parent it has if (this.parent) { this.parent.removeChild(this); }
  18. You can access the raw html video via videoSprite.texture.baseTexture.resource.source So from there you can set the currentTime to manually change the play location - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
  19. I've added a pr to make updateText public!
  20. Haha np! If there's one thing I've learnt in programming: we're all dicks at one stage or another!
  21. asset.interactive = true; Rather than your setInteractive property
  22. You'll get the same result in doing both. If you were gonna reuse that texture in other Sprites later on, it might be handy to have a reference to it? Otherwise I'd use the 2nd because it's quicker to type
  23. Good effort without looking Ivan! It's texture.baseTexture.resource.source
  24. I wonder if text metrics are sometimes being generated before the font has actually finished loading, thus spacing is thrown off when it then generates text with the loaded font. You often need to have used a custom font once in the dom before it'll then work everywhere else. I reckon isn't miles away from what your issue is. Different symptoms to the same underlying issue.