Outfire

Members
  • Content count

    12
  • Joined

  • Last visited

About Outfire

  • Rank
    Member
  • Birthday February 7

Profile Information

  • Gender
    Male
  1. Outfire

    Doubt: How to find these images using pixijs?

    @Charles Pimentel You can find all images by use developer tools and choose tab "Sources"
  2. I have a game with a lot of containers and sprites. I used GPU-Z for testing. After I replaced all containers and sprites with 2D, GPU load decreased on 20% What is the reason of that? What is the difference between container / sprites and container2d / sprite2d?
  3. Outfire

    Spine performance

    Here is the example. For create single spritesheet i used unpacker for all spines atlas, took all images and pack them by texturepacker.
  4. Outfire

    Spine performance

    Increase fps to 60 for spine test and now 1) 64% 2) 73% For sprites test 1) 96% 2) 77%
  5. Outfire

    Spine performance

    I have canvas 1920 x 1080 and 5 different Spine animations that uses a lot of textures. Add 20 animations of every type all over the screen Test performance in two ways. For this I use GPU-Z and check GPU load parameter 1) Every animation has its own atlas with images and json file - GPU Load 47% 2) Every animation has its own json file but uses the same atlas with images - GPU Load 61% Made the same tests with sprites as well, total amount of sprites is 180, 10 of each type. 1) Each sprite has its own download link - GPU Load 90 % 2) All textures are in the same spritesheet - GPU Load 63% Why tests with Spine have opposite results? PC config is Google Chrome v65, Windows 10, AMD Radeon HD 7450, Intel Xeon x5650
  6. Outfire

    PIXI js game black screen delay

    Its happens because you need time for loading sprites Backgrounds loading when game start create, so with slow internet connection you can see the man who walk on black screen. You can give name for your sprite and use it for search. https://jsfiddle.net/ra303eu9/28/
  7. Outfire

    RemoveListener for Spine animations

    I considered on how to implement function to remove listeners, and here is the result. The following code can be used to remove function from particular listener. PIXI.spine.core.AnimationState.prototype.removeListenersByName = function (findListener) { this.listeners.forEach( listener => { for(let currentListenerName in listener) { for(let findListenerName in findListener) { if (currentListenerName === findListenerName && listener[currentListenerName].name === findListener[findListenerName]) { if(Object.keys(listener).length === 1) { this.removeListener(listener); } else { delete listener[currentListenerName] } } } } }) } spine.addListener({ complete: foo, end: bar }) removeListenersByName({ complete: 'foo' }) removeListenersByName({ complete: 'foo', end: 'bar' }) But this solution has one problem. spine.addListener({ complete: foo.bind(this)}) Then listeners[0].complete.name will be 'bound foo', not 'foo'.This problem can be solved in the following way. PIXI.spine.core.AnimationState.prototype.isBounded = function (listenerName, findName) { let splited = listenerName.split(' '); if (splited.length === 1) { return false; } return splited[0] === 'bound' && splited[1] === findName } PIXI.spine.core.AnimationState.prototype.removeListenersByName = function (findListener) { this.listeners.forEach( listener => { for(let currentListenerName in listener) { for(let findListenerName in findListener) { if (currentListenerName === findListenerName) { let currentName = listener[currentListenerName].name; let findName = findListener[findListenerName]; if (this.isBounded(currentName, findName)) { findName = 'bound ' + findName; } if (currentName === findName) { if(Object.keys(listener).length === 1) { this.removeListener(listener); } else { delete listener[currentListenerName] } } } } } }) }; Some other issue can appear. spine.addListener({complete: () => console.log('something') }); Here listeners[0].complete.name will be 'complete', as the name of the listener, to which function it was bound. But it's just information. To remove all functions from particular listener. PIXI.spine.core.AnimationState.prototype.clearListenersByName = function (listenerName) { this.listeners.forEach( listener => { for(let key in listener) { if (key === listenerName) { if(Object.keys(listener).length === 1) { this.removeListener(listener); } else { delete listener[key] } } } }) } spine.addListener({ complete: foo, end: bar }) spine.addListener({ complete: foo}) clearListenersByName('complete') That is the result of my small expierence in js.
  8. Outfire

    RemoveListener for Spine animations

    Yes, it is my problem if I forget that I already have listener with the same name. I think variant - "spine.removeListener({complete: 'log'})" (event name and listener name) - is the best way and pretty obvious one. And "spine.removeListener({complete: ['log', 'update'], start: 'playSound'})" to remove multiple events. Perhaps is it possible to upgrade clearListeners function , so it takes event name as an argument and as result removes all listeners subscribed to this particular event?
  9. Outfire

    RemoveListener for Spine animations

    Need some time to think about it. I think about "spine.removeListener({complete: log})" But we can add "log" twice or more in one "complete", and then our removeListener must remove all "log"s in "complete" or just the last one. Maybe it is possible to do like in DOM addEventListener, when you add new listener on the same event with the same listener name it removes old one and push new one instead of it .
  10. RemoveListener is works, but only in one way: let spine // our spine animation let log = () => console.log('nonsense'); let listener = {complete: log}; spine.state.addListener(listener); And removes it like spine.state.removeListener(listener); It does not work if i do it like this: let spine //our spine animation let log = () => console.log('nonsense'); spine.state.addListener({complete: log}); // trying to remove spine.state.addListener(log); // or just like this spine.state.addListener({complete: log}); Works fine if add and remove only the same object, but its long way. Is there another way to do this?
  11. Outfire

    One atlas many json for spine

    Thanks! All is fine.
  12. Outfire

    One atlas many json for spine

    I want to use one atlas for many spine animations in my game. I found the way how to do it with loader. I am loaded atlas with game loader (name other.atlas) and got in game.loader.resources.other. Then i am trying to load json file of my animation from console. otherLoader = new PIXI.loaders.Loader() spineLoaderOptions = { metadata: { spineAtlas: 'game.loader.resources.other' } }; otherLoader.add('someJson', 'static/img/content/fullHD/machine/elements/testJ.json', spineLoaderOptions) .load() But it will not work. Loader still wants to load atlas with name of my json. GET http://localhost:3004/static/img/content/fullHD/machine/elements/testJ.atlas 404 (Not Found) I think it is because of atlas parser . I need varibale "pages" in my metadataAtlas, but there is no pages. How atlas data looks like in console. I am doing something wrong and i dont know what.