Jump to content

themoonrat

Members
  • Content Count

    313
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by themoonrat

  1. iPads now support the full screen API, however, if there is a constant interaction with the screen, it pops up a dialogue to make sure you're not unintentionally using a game keyboard. Dismiss it.... and it'll come back again next time it things you've pressed the screen too many times again. Which makes it useless for games. Had to add specific code which was 'use full screen API if it exists unless you are iOS'. If they add iPhone support, I don't trust that they'd also make it useless there.
  2. That's a pretty good shout Ivan. You could also combine the 2.... if your game is state machine based, you could set max fps to 0 when an animation occurs (unlocked fps) and then to 10 when the game is idle. Or, if on battery saving mode, yeah, limits to 30 when animations occuring. @jamesfdickinson "Do most other games just heat up the mobile device?" So, I'd say that's a simple question but not a simple answer. So I'll put some points from my experience. * When developing games, the game designers prioritise how it looks over battery life / phone getting hot. It's easier to g
  3. PixiJS renders when the render function is called. If you're currently using the Application class, then it creates a ticker that automatically calls the render function. You can either not use the Application class or set 'autoStart' to false.
  4. It should be 'fontName' when creating BitmapText. https://pixijs.download/v6.0.0/docs/PIXI.BitmapText.html Docs are correct when describing properties, but example at the top is incorrect. Sorry about that, we will correct soon!
  5. The ticker class within pixi is based upon request animation frame, and that gets paused automatically by the browser when on another tab for efficiency reasons (why have a background tab eating up resources). There's nothing you can do to get around this... you could try animating based off your own version of a ticker that's say, based on setTimeout, but bear in mind it'll still get throttled in the background by most browsers, but at least it'll still run
  6. It's by design, because I may have some children that I want to add to one parent one moment, then to another parent the next. If you went through each child, and called destroy, then that child will automatically remove itself from the parent, so maybe that's the better way to go?
  7. Scoping alienAnim is created in one function, then in gameLoop you try to refer to it, but its not in scope. I'd expect a browser to show a reference error.
  8. For 1. Try setting https://pixijs.download/dev/docs/PIXI.settings.html#FAIL_IF_MAJOR_PERFORMANCE_CAVEAT to false For 2, could you try the latest Dev version please? Or latest release candidate at least, As I know there have been PRs to standardize access to the top level scope, away from window. And that might help in this scenario?
  9. https://pixijs.download/dev/docs/packages_core_src_textures_Texture.ts.html#line266 Texture objects emit an 'update' event So you can do texture.on('update', () => { console.log(texture.valid) });
  10. Ah haha the Megaways chestnut. Still working in slots, so something high level. Hmmm. The main advise would be to not try to make it work in the same visual code as normal reels. They move differently, they work differently. When they are spinning, they all move the same amount of pixels per second, so giving them all that same velocity keeps them lined up there, but when they land, you know that the 'final' position will be adjusted depending on the height. You can either hard bake in these offset positions in, or pre-calculate them. Per size, per index. So imagining a center point
  11. Indeed. Go with whichever way makes it easier for you to manage in code. The issue I see with your first path is that it doesn't play well with wanting to animate symbols bouncing as they land, or animating wins. You may want to consider a custom class to deal with how symbols work rather than relying on a single animated sprite.
  12. The docs show the correct usage parameters to be name, style, options BitmapFont.from("ExampleFont", style, { chars: BitmapFont.NUMERIC }) You have put the chars property with in the style object, when it needs to be in a new object passed in as 3rd parameter.
  13. The thing with custom fonts, is that, once loaded, the first instance being used doesn't work, but after that it does. So if you're creating text before ffo is finished, or during it finishing, then I'd totally expect to see it not working on text drawn at one time compared to text created / drawn at another time. If you want to 'force' text to redraw, call updateText on it. But that's a brute force method rather than solving the underlying issue.
  14. I recommend using https://github.com/bramstein/fontfaceobserver to load custom fonts before creating pixi text objects
  15. No downsides that I know of, or on games I've released. https://github.com/pixijs/pixi.js/issues/6853 got the potential to make it true by default for pixi V6, and examples for other libs like three where a certain setting to WebGL is just slow on certain intel gpus
  16. Have you tried setting transparency to true when creating the renderer? A lot of people have noted it gives a big boost to performance, for some reason, with Intel GPUs. By default it is false
  17. The very latest version of pixi let's you dynamically create a Bitmap Font, which I think would work really well here. https://pixijs.download/dev/docs/PIXI.BitmapFont.html#.from You get the flexibility of dynamic styles, as PIXI.Text can generate, but it'll generate texture atlases for you so the rendering speed, and changing text speed, will be as fast as BitmapText Initially it could just generate the ASCII characters, but if you detect a different character you can regenerate the atlas?
  18. Short answer. Not much. Slightly longer answer: the Ticker class uses requestAnimation to do the looping, just as would be recommended if handling calling render yourself. It just handles some edge cases with ordering and timing when adding and removing things to this rAF callback, adds a bit of useful information, like a delta, and lets you control the minfps / maxfps and speed of the ticker. There is nothing wrong with not using it at all. But what it contains are the kind of things you may start to realise are useful as you progress
  19. fontfaceobserver is the one. PixiJS wise, either wait until the successful callback function from ffo has completed and then create text using the custom font, or do a force refresh of all the text using updateText function on the successful callback. Basically, don't try to render text with a custom font before ffo has done its thing
  20. The 'from' function here is meant to be to generate your own bitmap font dynamically from a text style... which uses the Text class on the background. And the Text class uses the Canvas API to generate textures. You can use custom fonts via loaded woff / woff2 files, just like in html and CSS. But you cannot use a Bitmap font as a source to draw regular Text
  21. Timing is never a browsers strong point 😕 One option is to have, say, 3 pieces of music, all the same length, all set to loop, all set to start playing at the same time. But you change the volume of them to say, bring one bit of music whilst another fades out. Think of it like layering instruments in an orchestra.
  22. I'm sorry you don't like the solutions, but it's not something that's really come up before that people haven't been satisfied covering with the existing methods. There is nothing more we can give here.
  23. From the comments... if you didn't want any move events in your game, then that is a reasonable way to do it. There's no simpler way either at a top level or on a per component level. It's that or digging into overriding functions, like Ivan suggests above, so that if the event is a move event, it's ignored if the component contains a flag or something
  24. The reason the hitArea helps is because it uses that instead of searching through children to find the hittable areas. So if you require interactivity, hitAreas are the way to go. I'm not sure why this wasn't acceptable in your opening post? What issue were you having with them? They work on all events. In any case, for really complex scenes, what you could do is have an extra layer, where you put either transparent sprites, graphics or containers with their own hitarea - which are purely for hit areas for the scene below? So instead of stage --> armatureDisplay you ha
  25. If you could put a little demo on https://www.pixiplayground.com/#/edit we could take a look for you
×
×
  • Create New...