• Content Count

  • Joined

  • Last visited

  • Days Won


xerver last won the day on September 16 2016

xerver had the most liked content!


About xerver

  • Rank
    Pixi.js Moderator

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location

Recent Profile Visitors

3,177 profile views
  1. Best place to start is the profiler, what is taking 15ms? Can you make a playground example?
  2. xerver

    Best performance way to extends a PIXI class ?

    Fair enough, I would still remove the mix of es5 functions (.prototype.func = function () {}) and just use es6 functions. But it makes sense why you are using an IIFE. Just so you know, if you use a module system like CommonJS (require('...')) or ES6 Modules (import from '...') then the bundler (Webpack, Rollup, etc) will usually wrap each of the modules in an IIFE for you. If you are just concatinating js files together then you should keep the IIFE.
  3. xerver

    Separating Draw and Game State

    To answer your original question: Yes, adding/removing all your sprites every frame is expensive. Instead, track state and only change the minimum amount you have to. If a sprite exists between two frames, then it shouldn't be removed then added again. Ivan's example was to show you he isn't changing the scene tree at all unless he needs to. When something dies, it gets removed. When it is new, it gets added. Otherwise, no change.
  4. xerver

    FPS Drop on setting object properties

    Have you profiled it? Without profiling, you are just guessing as to what is taking your time. I seriously doubt that object property lookup is your bottleneck.
  5. xerver

    Best way to extract a very large container/sprite

    Sure, you can use SVG or DOM elements instead. Using SVG makes it really easy to export as well, you just save the SVG as a file. Or have a server rasterize it and send them a PNG.
  6. xerver

    Best performance way to extends a PIXI class ?

    They are identical. The "class X extends Y" syntax was added into ES6 as just a syntax sugar for the second snippet you posted (which was ES5). However, you should simplify by removing the IIFE and not assigning to prototype: class ContainerData extends PIXI.Container { constructor() { super(); this.Sprites = {}; // others custom proprety for game obj } get d() { return this.Sprites.d } // return diffuse sprites get n() { return this.Sprites.n } // return normals sprites //TODO: spine normal are arrays createJson(dataValues) { } asignJson(dataValues) { } } No need for any of that wrapper code, if you are using ES6 then just use ES6.
  7. xerver

    forceCanvas property of PIXI.Application having no affect.

    It does, but you need to use the pixi.js-legacy bundle which includes the canvas plugin.
  8. xerver

    Can´t manage AnimatedSprite to work

    OK, so the reason this fails to parse the spritesheet data is because it doesn't detect that this URL is json. It fails because it uses the extension to see if it is json, and the url in your playground doesn't have a json extenion. After I update it to specify manually to treat it as json it works as expected in terms of loading. There is still an error because the SpritesheetParser is pixi doesn't find any animations in your json data, it is looking for an "animations" property which doesn't exist in your json data. Hopefully this helps! I updated your playground to specify JSON as the XHR load type: https://pixiplayground.com/#/edit/uX4ioEwjSYJS0bpMTATk7
  9. xerver

    Can´t manage AnimatedSprite to work

    The error looks like PIXI.loader.resources doesn't contain an entry for the sheet you loaded. Can you inspect the PIXI.loader.resources object when you are in the setup function? I'd be happy to dig further if you can make a running example of the issue happening. Should be easy to make a https://pixiplayground.com/#/edit that reproduces your issue.
  10. xerver

    Best way to extract a very large container/sprite

    Am I understanding correctly that you want to export an image of a chart that is larger than the size of the canvas that is rendering it? If that is what you want, I don't think there are going to be good web apis to help you here. What you would need to do is render different rectangles of the chart which you composite together into an image format. unfortunately, if your site is remote there isn't a good way to do that.
  11. xerver

    Loading Video As Data URI?

    What does "it doesn't work" mean? What errors do you get? Have you stepped into the fromVideo function to see where it breaks down?
  12. xerver

    Pixi.js Showcase

    Hey all, just wanted to mention I've released a new app called Pixi Playground that allows you to create and share pixi demos! App: https://www.pixiplayground.com/ Repo: https://github.com/englercj/playground Announce: https://twitter.com/rolnaaba/status/1037788610915782661
  13. xerver

    Need faster result than pixel() to get filter output

    If you don't need the pixel data on the CPU then don't extract it, just write it to a framebuffer and use it in a different shader. If you do need the pixels on the CPU (becuase you need to write them to disk or some such) then this is the only way.
  14. xerver

    Repeated Texture

    It is a float, we just pack it into 16-bits. All values in GLES 2.0 (without extensions) are floats. Do you have a running example where a single TilingSprite runs at 5FPS? I've never seen anything like that. Also, I wouldn't make the texture frame size bigger than the actual size of the image; you likely won't get results you want. Instead just use the width/height parameters to the TilingSprite constructor.
  15. xerver

    Get parent width\height on added

    A container's width/height is the union size of the children it has. It has no explicit width/height otherwise. Setting a child to a % of the container width/height is a weird thing to do, because the child width/height/position affects the parent width/height. I don't think you want to use .width/.height, but instead have a "real size" that you store separately that is just a number, not a union of children sizes.