themoonrat

Members
  • Content count

    107
  • Joined

  • Last visited

About themoonrat

  • Rank
    Advanced Member
  • Birthday 11/25/1982

Contact Methods

  • Website URL
    http://www.moonrat.co.uk
  • Twitter
    themoonrat

Profile Information

  • Gender
    Male
  • Location
    UK

Recent Profile Visitors

829 profile views
  1. And unrelated(ish) - I always recommend creating sprites using Sprite.fromFrame() if you expect them to be preloaded. fromFrame will only look in the texture cache, and report an error if it's not found fromImage which will try to load the image if it's not in the texture cache If I know I'm preloading assets, I'd rather get an error that it doesn't exist and work out why.
  2. If you wanted to be super quick about it, you could just iterate through everything in PIXI.utils.BaseTextureCache and upload everything from there.
  3. With JavaScript in the browser, you have to take the attitude that every line of code delivered to a user can be changed by them. So, taking away the tickets speed existence wouldn't solve anything, as they could manipulate the time deltas coming in from requestAnimationFrame manually (which is all the speed variable does in a ticker. You need the server to authenticate everything that the client is sending to the server. Validation on when the client is sending data to the server; ranges for how many times a second for example....and validation on every bit of data send to the server. If the client code is set so that it takes a player 1 second to run 100 pixels to the right, the server needs to validate this; if a client was x pos -500 one moment then x pos 500 the next, you know something fishy is up!
  4. It inherits from Container, but overrides a few critical methods related to updating the transforms and for rendering, in both cases optimising them for particle usage. The quickest way sometimes to look at the code rather then going though github is to go via the docs: http://pixijs.download/dev/docs/particles_ParticleContainer.js.html
  5. Don't worry about it, we've all been there at some stage!
  6. It's because you have a div that sits over the top of the canvas 'game-over-overlay' This is blocking the canvas getting interaction events
  7. https://www.youtube.com/watch?v=T6fVDAjs9f0
  8. First, personally, I wouldn't use window.devicePixelRatio as the resolution modifier. If the resolution of the game is 960x540, and you use a devicePixelRatio of 3, then you're rendering now at a resolution of 2880x1620, which is pretty insane. By all means increase the resolution based on if the device screen is higher, or the device is more powerful, but I wouldn't link it necessarily to window.devicePixelRatio, and test out the visual quality yourself if you can see a difference. Second: I don't like the code you've pasted which forces the resolution of the text to match the resolution of the renderer. I believe you should be able to override it; so I might do a PR to allow that behaviour. Right now though you can achieve what you want by overriding this behaviour. Add the following code before you create the PIXI renderer. Now any resolution you set after creating the text will be the resolution used for any future updates of text; Object.assign( PIXI.Text.prototype, { renderWebGL: function( renderer ) { this.updateText( true ); PIXI.Sprite.prototype.renderWebGL.call( this, renderer ); }, renderCanvas: function( renderer ) { this.updateText( true ); PIXI.Sprite.prototype._renderCanvas.call( this, renderer ); } } );
  9. First of all, I always prefer the second syntax. sprite.on('click', callback) Second, you can use pointer events instead of having both mouse and touch events sprite.on('pointerdown', callback); Examples have all been updated recently, so might be with having another look through them. For example: https://pixijs.github.io/examples/#/basics/click.js And the docs show all of the available events you can listen to: http://pixijs.download/v4.3.4/docs/PIXI.interaction.InteractionManager.html#event:click
  10. Someone has provided a drop shadow filter at the bottom of https://github.com/pixijs/pixi-filters/pull/9
  11. After modifying the myLine.graphicsData Try doing myLine.dirty++
  12. I believe this PR may shed light on your issue; are you using beginFill or not with your mask? If not, it will not be interactive
  13. I like using https://www.codeandweb.com/texturepacker Use json output. Not free, but it's good!