• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by themoonrat

  1. If i were you, I'd look to use howler v2 than try to make your own thing
  2. A child will always be affected by it's parent. Position, scale, alpha.... any transformation. It makes sense; if you write your name on a piece of paper, then move the paper away from you, your name will look smaller. Your name hasn't actually changed in size, but the parent (the piece of paper) naturally effects it's children (your name). If you want 2 sprites to be 'together' but not be effected by each other, then create a new group and have that become the parent -
  3. @tips4design - I've found occasions where certain mobile devices report as supporting WebGL, but actually have a buggy implementation so need to be forced to use Canvas @selvam Using WebGL mode should not effect events. Increasing FPS is not something that can be helped without seeing the game code. Do a search on the forum and you'll find plenty of others who've asked more general tips on how to improve FPS; take a look and see what helps
  4. Your code should be prepared to use Auto by default, but maintain in your code a list of devices you force to use Canvas. These could be detected via user agent, browser api availability, screen size, dpi, os, etc etc. No other way around that, really.
  5. Yes, Linux has a case sensitive file system, so be careful with paths and filenames!
  6. There is no nice way, I'm afraid. The best thing to do is compare the window.innerHeight to $(window).height() If they are the same, then the url bar is hidden. If they are not the same, then the url bar is shown. In this case, put a large div overlaying the entire screen, giving it a lot of height. Have a message on the div instructing the player to 'swipe up to play'. This will simulate scrolling down the webpage, and in safari this will then hide the url bar. Once window.innerHeight matches $(window).height() again you can hide the overlay. Not fun, not sexy, but it's the only way :/
  7. When you set the width & height of a sprite, internally you are actually ARE changing it's scale. Thus, you have scaled the first bunny - and since the second bunny is a child of the first bunny, it will also get scaled.
  8. Indeed; after I've created my renderer I often create and add containers onto the parent, so I have my layers this._baseContainer = new PIXI.Container(); this._layers = {}; this._layers['game'] = new PIXI.Container(); this._layers['ui'] = new PIXI.Container(); this._layers['debug'] = new PIXI.Container(); baseContainer.addChild( this._layers['game'], this._layers['ui'], this._layers['debug'] ); I call render on the baseContainer, and then have an api of getLayer( layerName ) for other components to grab a container they can draw to.
  9. May or may not be related, but it seems others have had issues on some lower end Samsung devices with the WebGL renderer. For example:
  10. Are those 2 devices using WebGL or Canvas rendering? If they're using WebGL, does forcing to Canvas solve the issues?
  11. let graphic = new PIXI.Graphics(); // Make graphic however you want // renderer is what was returned when you first created the pixi renderer via 'let renderer = PIXI.autoDetectRenderer()' let texture = renderer.generateTexture( graphic);
  12. It all depends on what devices / browsers your customer is asking you to support. If you know your device list it's easier to make the call. For what I do, which is making games to be played in the browsers of mobile devices, canvas support is still required IMO. Older IE usage is significant enough that customers would prefer us to support them, players on older Galaxy devices just use the internet button so aren't running a modern Chrome, and Chrome itself has a blacklist of devices / graphical driver versions which it deems are buggy and cause too many issues when WebGL is used, even though theoretically they're capable. But the time to drop it is close. A year, maybe 2 max.
  13. PIXI becomes Internet Explorer exclusive.
  14. PIXI v4 has the ability to listen to interaction events globally as well as through display objects. For example: renderer.plugins.interaction.on( 'mousedown', function() { console.log('mousedown') } );
  15. It isn't outputted to the JSDoc, no. I'll do a PR at some point to add the listenable events to the interaction manager documentation
  16. var anim = new PIXI.extras.MovieClip( textures); anim.loop = false;
  17. It's 'wordWrap'; the function looks at the string, and if it is too long, replaces a space with a new line. Because you only have one word, and therefore no spaces, it cannot find a place to insert a new line to keep the text within the wordWrapWidth
  18. The available events are 'mousedown','mouseup','rightdown','rightup','click','rightclick','mousemove','mouseover','mouseout','mouseupoutside','rightupoutside' so you need to listen to rightdown for right mouse button presses
  19. If you mean resolution being something other than 1, then yes. If you mean adjusting the size of the canvas via css, then yes. If you mean scaling the parent of accessible objects, then yes. If you mean scaling actual accessible objects, then yes.
  20. Slotted it into one of my games that uses 2 canvases layered on top of each other.... and..... everything pretty much worked!!! Which was a massive pleasure, since last time i tried that old webgl-2d project, it drew my game into a small corner of the window! Will investigate more for to see if there are actual performance benefits for the variety of devices I have to develop for. The only place it didn't work correctly is when dealing with globalAlpha I believe. The sprite class I use does a, changes globalAlpha, draws the image, then does a ctx.restore(). With pixi-canvas, as more and more faded images are drawn the globalAlpha decreases further and further towards 0, until the game is fully transparent!
  21. A lot of what become bigger projects start off as "i think it would be useful to me if i made library x, and it would also be fun/interesting/educational to me too". It's that kind of statement that keeps up your interest in not just starting, but finishing a project to a releasable state. "I'm going to make library x because i think other people might use it" tends to lead to abandonment, because you have less personal drive to invest your own time into it. My personal opinion? I'm with Rich, there are plenty of engines and toolsets like Unreal & Unity, down to libraries like Cocos and SFML. But it sounds like a cool personal project that'd gain tons of knowledge on how both libraries worked.
  22. By default, the tweens start playing after the last one has finished. If you want them to happen at the same time, you need to use the position parameter For example, this sets the starting point for all tweens at time 0 of the timeline, which is what you require var animation=new TimelineLite();,1,{x:100,y:100},0) .to(container.scale,1,{x:2,y:2},0);
  23. This isn't a Phaser issue, but a device/browser limitation.
  24. It feels like there's a memory leak. Either a PIXI object that contains an event emitter is not getting destroyed correctly, or listeners are being added but not removed, and so the number of Event Emitter listeners grows and grows. PIXI objects that contain an Event Emitter that I'd start looking at mostly would be: Texture, BaseTexture, DisplayObject (which in turn is inherited by Container which is in turn inherited by Graphics, Sprite, Text, BitmapText, Mesh & ParticleContainer) But these also contain Even Emitters Ticker, SystemRenderer, TextStyle (if on v4) I'd be very tempted to put some logging within EventEmitter within the 'EventEmitter.prototype.on' function, and log out the number of listeners for each event when another listener is added. I'd also be tempted to put logging into the constuctor and destroy method for a DisplayObject, to count out via a global var how many active objects there are. (+1 the total after a constructor is called, -1 when destroy is called). In one of those cases I'd hope you'd see something abnormal!
  25. With the Text class, you can choose to turn on and off word wrapping after a certain length, but what I require is to be able to limit the width and/or height of text. If I have a button of a certain size, I want the text 'Bob' to fit in it's natural size, and the text 'BobBobBobBobBobBob' to scale down to fit within this button. Scenario 1: Limiting width. This is actually quite easy, with word wrapping off, because after drawing the text, if the canvas width exceeds how wide I want it to be, I can just scale it down. Scenario 2: Limiting height. Now, in this scenario, word wrapping is on, so it's already wrapping at the appropriate width. However, I can't use the above method to scale the resulting canvas, because then the width would also be reduced, and I don't want that. I do have a very hack solution to these scenarios. Hack on scenario 1 requires checking in renderWebGL if I've scaled down due to limiting width, and if so record some variables so that if I scaled it up and down via .scale things still work. Hack on scenario 2 involves recursively calling updateText with smaller text sizes until it fits within the correct height! Ouch Wondered if anyone had thought about this before and come across any better solutions?