• Content Count

  • Joined

  • Last visited

Everything posted by bbyford

  1. 4136 × 3935 currently, its a spritesheet that is packed as part of the build, so often goes up and down in size. Is there a common pattern for preparing assets for Pixi and I've come faul of this issue a few times.
  2. Only seem to ever get this error on live and not locally, doesn't seem to be a rythm nor reason to when it might do it. Any advise on this one, as sometimes it doesn't it and sorts itself out (cache issue maybe), and sometimes it doesnt it all the time and there doesnt seem to be anything i can do to stop it happening example
  3. care to elaborate? is that any combination like: 1x4096, 2048x2048 etc? Or the square of 4096 to produce a square factor for width and height?
  4. The site doesnt mention what the measurement is, can i presume its 4096 bytes?
  5. I get the same error when hosted but not on local. which seems odd, is there a max texture image size? do you normally split into several spritesheets?
  6. bbyford

    WASM in pixijs

    Just wondering if Pixijs currently has or is planning to use WASM for its core library? Been a little while now and WASM has pretty good browser support, game engines are good candiates to get some of its benefits and wondered if this was something that would happen or would mind someone tinckering with maybe in the community?
  7. Thanks, I'll look down Observer route.
  8. Hi, probably one that crops up a lot - is there a good way to wait, or check load of webfont before displaying? The webfont, supplied by google, currently works fine on second load but on a hard refresh often defaults to a system font which makes literally the whole game look aweful. Also, I find that the font is anti-alised which looks bad against the games pixel art look, is the a setting that sorts this at all?
  9. Thanks @ivan.popelyshev simply el.emit('pointerdown'); did the trick 👌
  10. How do I dispatch an event on an object?? For example if you have an interactive sprite with an on pointerdown event listener start_button.on('pointerdown', handleClick); how can you trigger from javascript??? Couldn't find anything useful in the docs for the events manager.
  11. Hello, I'm making a browser game where the only saving is done to localstorage with JSON data. I've seen some odd behaviour and wondered whether locastorage is actually reliable enough for save data and whether its worth putting in a backup / saving somewhere else too just in case? All opinions welcome.
  12. Having issues fading out audio and play them again without duplication. I wondered if I'm using the pixi.sound library wrong as I've been setting a let music = PIXI.Loader.shared.resources[audio_name].sound and fading out that audio using it's volume. Then I create a new object with a variable for the same sound and now I get two versions of the audio... is there a common pattern for playing and stoping audio to stop duplication?
  13. really cool, I didnt see anything to detect whether that named child exists or is attached to that object–you just using it knowing it does in this case?
  14. Thanks for baring with me @ivan.popelyshev coming from Unity3d land I've got a mental model of gameobjects which I need to either build into pixi i guess or let go of. I'll try and build a meta structure on top. Thanks!
  15. I guess this is my point. How do you add and remove things when you dont know what they are?! Whats the workflow for adding and removing objects as at the minute I have to add and then clear everything to add more stuff.
  16. ok cool, but if I assign a sprite a = someName and use getChildByName on it's container will bring it back? Or should i simply look after all my objects myself and just use pixi just to draw? or is it ok just to constantly add and remove things from the app.stage as i've been trying not to add and remove to often (e.g. in the Ticker).
  17. Been working with Pixijs for a month of so now and haven't found a good way of identifying sprites or containers in other containers. How do you get or adjust sprites and containers within containers? I'm been looking at: .getChildbyName but what name? And .getChildAt but how do i identify it amongst many other objects that could be returned? is there a design pattern I'm missing here, or a built in id for each created sprite that I can use to lookup or a name that I can assign? Cheers.
  18. this is great, thanks for the example. I will want to do something similar as I'll be adding and removing from the stage but reusing again later so not destroying.
  19. So I guess the anwser is, there is no best way. I want to kill everything on screen and re build, e.g. move to a new scene... this makes sense for how my mind is viewing the game and how pixi works, and I was hoping that there might be wisdom for a best case, or normal way of proceeding. This not the case then it sounds like someone (maybe me) needs to work it out and write a tutorial and its seems pretty basic to want to add and remove sprites and containers without them lingering on screen or having to do strange hacky things.
  20. I'm trying to remove sprites and containers from the current app.stage as to add new ones–e.g. change scene. However, both: let i = 0; app.stage.children.forEach(function(child){ app.stage.removeChild(i); i++; }); and app.stage.children.forEach(function(child){ child.destroy(true); }); remove the top level sprites but not the ones in a container?! Very strange. A second trigger of either of the above then removes them but I'd rather not trigger a function twice without working out why it's not working. I'm running pixi.js - v5.2.0
  21. AHHHHHHHHH thank you. I'm such a dick. Sometimes you just hit your head against a problem, and sometimes you've created that problem and can't see it
  22. Ok, so i simply can't get anything to register an event after having it previously working fine. Is there something global I might have done that stops these from happening?
  23. I'm adding a sprite in a loop, set interactive and then adding it to a container then the stage but my on events dont seem to be working, any reason why this might be happening? let map_asset_keys = Object.keys(map_assets_json); let length = map_asset_keys.length; let map_assets_arr = [] for (var key in map_assets_json){ let asset = new Sprite(Resources[key].texture); asset.x = map_assets_json[key].coords.x; asset.y = map_assets_json[key].coords.y; asset.zIndex = length; asset.setInteractive = true; asset.cursor = 'pointer'; asset.on('pointerdown', function(){alert()}) asset.tint = 0x550000; map_assets_arr.push(asset); --length; } let map_group =; map_group.x = 0; map_group.y = 0; map_group.scale = new PIXI.Point(map_assets_scale * pixel_scale, map_assets_scale * pixel_scale); map_group.setInteractive = true; app.stage.addChild(map_group);
  24. I'm trying to work out how to log asset byte sizes after load. e.g. something like this: PIXI.Loader.shared.add("bg", "img/bg.png") .on("progress", loadProgressHandler); function loadProgressHandler(loader, resource) { console.log(resource.size); } This possible?