• 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

2,165 profile views
  1. We just echo the events the browser sends, so our behavior will match your browser's. Specifically for "tap" we send the event on touchend. There is no timing of how long the touch lasted.
  2. Use raw WebGL texture as sprite

    Note that you cannot share GLTextures between contexts. If you create a texture using a context it will not work if you try to render it with a different context.
  3. Electron uses something similar called asar that works pretty well. I think it would be cool to see something like that in browserland (but optimized for network). https://github.com/electron/asar
  4. PIXI loader doesn't recognize pictures?

    You can just assign the baseUrl property before adding resources, you don't have to create a new loader. fromImage is working here but the image is loaded asynchronously. Which means you won't know the size until later after the image has loaded. There are events you can listen to, but it is honestly easier and more robust to use the loader than it is to use the fromX() methods.
  5. Extending Sprite Class

    Unfortunately it is not. If you assign the prototype object (like happens in the line above) then .prototype.constructor will not be properly set. Normal usage you wouldn't notice because the new operator would work fine. However if you ever needed to read the constructor value from an instance (which I have had to do) it would be wrong if the person extending the prototype didn't reset it properly. Take for example a scenario where you need to create a new instance from an existing one. You could do something like: (var obj = new otherInstance.constructor()) which would obviously create the wrong instance unless you set it up properly. Also some debugging utilities read the .constructor property and will pull the wrong one if it isn't set. You don't *have* to reset it back to a correct value, but it is good practice because not doing so might lead to unexpected behavior down the line. The extend keyword does this for you in ES6. A quick correction here, setting the .constructor prototype property does not effect how the new operator works. `new` simply will run the function you specify as a constructor.
  6. baseTexture from loader alias

    Yup, sorry about that; I'll edit my original post.
  7. baseTexture from loader alias

    No need to use fromX methods, just use the resources the loader made for you: PIXI.loader.add("sprites", "sprites.png"); PIXI.loader.load(function () { const baseTexture = PIXI.loader.resources.sprites.texture.baseTexture; // loader made you a base texture, no need to create your own. }); Additionally, don't do "new PIXI.BaseTexture.fromX()" the from methods are not a constructor. Either do "new PIXI.BaseTexture()" or do "PIXI.BaseTexture.from()" or (my preference) do neither and just use the one the loader made for you.
  8. Redraw only when needed

    I assume you mean if you are using PIXI.Application. You can also pass { autoStart: false } to prevent it from starting the internal ticker.
  9. Keyboard Movement Acting Weird

    Because every animation loop you are adding a new event listener for keydown. Each frame you are adding a new function that will add 1 to the X coord of you character. So by time you press 'D' there are a ton of listeners added and they all are adding 1.
  10. Isometric grids

    The size importance applies to the texture you upload to the GPU, in this case the texture atlas. The frame size you read from the texture isn't important (in this case).
  11. Pixi.js Installation Confusion

    If you are running the server locally on your machine and this translates to a valid url, yes this should work fine.
  12. Pixi.js Installation Confusion

    `npm install pixi.js` simply downloads the file into the node_modules directory, it is still up to you to ensure your HTML file loads it (along with your scripts).
  13. DOM Rendering Plugin

    Which library are you talking about? You linked a person's profile. If you are looking for a UI lib, https://github.com/pixijs/pixi-ui is pretty cool. Here are some others that came up when googling: https://github.com/Ezelia/EZGUI https://github.com/GreyRook/gown.js
  14. MP4 cannot add ref number to its path

    This is because the convenience methods (".fromVideo", ".fromImage", etc) are very lightweight and are really only meant for quick prototyping. Use the loader instead. https://github.com/pixijs/pixi.js/issues/4226
  15. Cross origin problem (spritesheet & mp4)

    This is because the loader loads the URLs it is given. You have the query string on the json file, but in the json file it doesn't specify a query string on the image, so it doesn't use one. You can check out the "defaultQueryString" property (http://englercj.github.io/resource-loader/Loader.html#defaultQueryString) which will add a query to the end of every URL that loader makes. That can ensure that everything is cache busted.