takopus

Members
  • Content Count

    6
  • Joined

  • Last visited

  • Days Won

    1

takopus last won the day on April 22

takopus had the most liked content!

About takopus

  • Rank
    Newbie
  • Birthday 01/11/1981

Profile Information

  • Gender
    Male
  • Location
    Moscow, Russia

Contact Methods

  • Twitter
    takopus
  1. Some time ago there was a bug report of a problem with rendering SVGs in iOS and MacOS, at least older ones. You can see it there: https://github.com/pixijs/pixi.js/issues/3433, but here is a short description as far as I've digged it. On some old Apple devices, iPad 4 / iOS 10 for me, if you load a number of SVGs, make sprites of them and place said sprites on stage, some of these sprites will 'leak' on one another. For example, if you load a green rectangle SVG and then blue circle SVG, sprite made from second one will contain expected circle drawn above unexpected rectangle. This is an old bug still found in v5.0.0 rc-3. Sadly, I found no solution to it. There are cases when it shows and cases when it doesn't, but no way to be sure. Since it is crusial for the project I'm working on, I've made a short test code to check if the current device have this bug, so I can switch to PNGs. In case anyone needs this, you can see it below. It is written for Pixi v5.0.0 rc-3 https://codepen.io/takopus/pen/EJpjXL The idea is simple: I load assets - rectangle and circle - make sprites, place them on stage and render it (you have to do it to catch the bug). Then I extract circle into Uint8ClampedArray of pixels and get alpha value of some corner pixel. If there is no bug, it will be 0 (since there is no pixel there). If the bug is here, it will be 255 cause of rectangle rendered below the circle. Hope this will help someone until this bug gets fixed!
  2. Ah, I see. Don't think it's necessary at this point. Thank you for your time!
  3. I fear I have no required knowledge in PIXI or actually JS to dig into all of this. And, sadly, my solution above helps with only a half of the problem. Now I can watch pointer movement, but I can't get "pointerupoutside" event. I catch "pointerdown" on some DisplayObject (scrollbar, actually) and add "pointerupoutside" on any of it's parents. But since said parent had not received "pointerdown" before, "pointerupoutside" won't fire. It seems to me that right solution may be simple: any listener, subscribed to "*move" and "*upoutiside" events must get them, regardless of hit test. If you have a minute to spare, could you please stick my nose to place in sources where I can try to make an override for this? Thanks for your help anyway!
  4. Ok, gonna share my own solution. Kinda dirty, but working. Hope this will help someone. First, add this little helper to DisplayObject. It will return nearest parent which is not inside a masked container (but can have mask, which is irrelevant): PIXI.DisplayObject.prototype.getNearestUnmaskedParent = function(){ var parents = []; var dobj = this; while (dobj.parent){ dobj = dobj.parent; parents.unshift(dobj); } for (var i=0, l=parents.length; i<l; i++){ if (parents[i].mask) return parents[i]; } return this; }; And now if you need to add event listeners to a display object inside a masked container, do it like this: this.onPointerDown = function(){ // get unmasked parent: this.unmaskedParent = this.myInteractiveObject.getNearestUnmaskedParent(); // store it's interactivity state and set it to true: this.unmaskedParentInteractivity = this.unmaskedParent.interactivity; this.unmaskedParent.interactivity = true; // set your event listeners: this.unmaskedParent.on("pointerupoutside", this.onPointerUp, this); } this.onPointerUp = function(){ this.unmaskedParent.removeListener("pointerupoutside", this.onPointerUp, this); // restore parent interactivity and forget it: this.unmaskedParent.interactivity = this.unmaskedParentInteractivity; delete this.unmaskedParent; delete this.unmaskedParentInteractivity; } this.myInteractiveObject.on("pointerdown", this.onPointerDown, this);
  5. I've found some strange behavior in interactivity events of display object inside a masked container. Not sure if this is a bug or just a questionable decision; anyway, it poses some problems. Generally interactive display objects receives events such as "pointermove" or "pointerupoutside" at any time, whether pointer is over them or not. Same applies to masked display objects, by the way. But if you place an interactive display object inside a masked container, events fire only when pointer is over masked area. All events, including "pointerupoutside", so there's no way to keep track of pointer position and button state. Look at this codepen. Have anyone faced this problem? I guess I can assign event listeners to the stage container or nearest parent without mask, and it will probably work, but seems a little bit dirty to me. Is there a better solution?
  6. Don't want to start new topic, will try here. I've been trying to use PixiJS Sound library and it looks and works extremely well, up until the point where I failed to find any kind of seek() method or any other way to set playback position. Is it really so or am I missing something? Thanks in advance!