themoonrat

Members
  • Content count

    211
  • 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

2,166 profile views
  1. themoonrat

    Pixi-Sound vs Howler

    Both are great options! The main advantage of Howler is it's wider use. I use it, and love it, and feel more secure in using it because so many devs do too. The main downside is fitting it into the Pixi loading process. Even if you download audio as a blob, you still need to account in your preloading process for passing it to Howler for it to be decoded. The main advantage for Pixi Sound is that it covers this integration for you. In production code, it's easier to get up and running. And the syntax and use is all very familiar because it was made by a Pixi Dev. But that's not saying Pixi Sound is not reliable, it is! And it's not saying Howler is hard to use... it really isn't. Both are great options with active and receptive maintainers.
  2. themoonrat

    Audio Format Compatibility

    1. I would use m4a as primary choice, and off as fallback. m4a has the same compatibility range on browsers as mp3, but sounds better for the same file size, and loops better for background music. ogg is the fallback for the uncommon occasion m4a isn't supported. 2. ALL mobile browsers now require a user touch to enable unlocking audio. If you have a 'touch here to continue' kinda screen after loading, that'll get you the touch you need
  3. themoonrat

    PIXI js game black screen delay

    They are popping in because the assets are loading in the background, and show when they've finished loading. To stop that effect, you should use the preloader within pixi to preload all assets (showing a loading screen perhaps) before starting the game
  4. themoonrat

    Audio on Mobile

    https://github.com/pixijs/pixi-sound is made to integrate into the loader that pixi uses, and is successfully used in a number of projects. You really want to use another lib to handle sound to get web audio support at the very least. Otherwise you're setting yourself up for more issues in the future.
  5. themoonrat

    Audio on Mobile

    I'd really recommend using Howler or pixi sound for audio, it'll handle this stuff for you
  6. themoonrat

    Audio on Mobile

    Mobile requires a user interaction to 'unlock' audio and allow it to play
  7. The scale mode of the texture needs to be set to nearest. You can either do that on a texture by texture basis via the scaleMode property, or change the default via http://pixijs.download/dev/docs/PIXI.settings.html#.SCALE_MODE
  8. themoonrat

    set and cancel fullsreen mode in mobile.

    For mobile devices, some of those events above are not classes as valid events to unlock audio or unlock full screen API. touchstart or touchend is usually what you need
  9. themoonrat

    WebP

    It's all about what the browser supports
  10. call .update() on the texture (the texture that is created with the canvas as the source) ?
  11. themoonrat

    Question about Pixi Interaction Manager

    Less telepathic, more your friendly neighbourhood @ping
  12. themoonrat

    Question about Pixi Interaction Manager

    So, what I do for my button class is something like this this.on( 'pointerdown', this._onPointerDown, this ); PIXI.renderer.plugins.interaction.on( 'pointerup', this._onPointerUp, this ); So, the down part looks for just the button being pressed down. But the up bit looks at the interaction manager global 'up' event. This way, if someone presses down on a button, then moves the mouse away from the button and releases, the 'up' still gets fired for this button. A quick overview of the pointdown and pointerup functions _onPointerDown( event ) { if ( !this._isDown && event.data.isPrimary ) { this._isDown = true; // do down stuff } } _onPointerUp( event ) { if ( this._isDown && event.data.isPrimary ) { this._isDown = false; // do up stuff } } So first thing we do is track ourselves if that button itself is down or up... that way on a global up, if the button is not down, nothing happens The other thing is we check against 'isPrimary', so we're looking at the primary mouse button, or the first touch event. You don't have to have that, and it stops a 2nd touch effecting a button press... but restricting it can make your life easier!
  13. themoonrat

    PIXI.TextStyle gradient stroke and pattern fillStyle

    When I saw the title I thought I'd done a pr for it at some stage! It wasn't accepted into pixi official because there were worries about the text api becoming a bit crazy. The hope in the future is that you could pass perhaps a PIXI.Gradient into the fill properties, and thus no need for separate stop point and gradient type settings every time it's an option. But I use the contents of that PR in my games on my own pixi fork
  14. themoonrat

    which audio format do you use for mobile?

    Just to second using Howler... it's the best audio lib out there IMO. Also second using m4a and ogg. mp3's have some issues in browsers with seeking and looping nicely, in my experience. I'd also recommend having different compression settings, which are selected based on the device. Mono 96kbps might be good enough for mobile devices, but maybe supply Stereo 128kbps (or above) for PC players where memory is unlikely to be an issue, and better speakers almost certainly going to be used.
  15. themoonrat

    [PIXI] Changing sprite textures

    http://pixijs.io/examples/#/demos/texture-swap.js