Jump to content

dmko

Members
  • Content Count

    101
  • Joined

  • Last visited

Everything posted by dmko

  1. Can you explain this a bit more? Will PIXI automatically destroy(false) unreachable DisplayObjects and/or destroy(true) unreachable Textures?
  2. dmko

    boilerplate setup

    Thanks for sharing an example! Though, it's very small.. seems like a case where adding the namespace doesn't serve any purpose at all (not that I have a problem with it- if it's the author's style in general and they simply carried it over out of habit that makes total sense to me). I'd need to see something something larger, e.g. a game or web app. Typically that would involve webpack or gulp at some stage (for example - relying on tsc to output one bundled file has lots of major issues that will haunt you at that stage, though it wouldn't have any problems with the example here. Gettin
  3. dmko

    boilerplate setup

    Not sure I follow... afaik webpack needs an entry point and will bundle up everything through the dependency graph created from that point forward... if something isn't imported it isn't bundled/useable. Not sure how the IDE is even supposed to know about it... if I don't import something, VSCode doesn't know about it at least with my current setup. Seems like you're proposing that everything in the folder should be automatically available to the IDE somehow, and also that it be included and injected into the global namespace (or some sort of global module that encapsulates everything).
  4. n/m I see it's the second parameter, e.g. loader.onLoad.add((ldr:PIXI.loaders.Loader, res:PIXI.loaders.Resource) => {});
  5. when calling loader.onLoad.add() it seems that it's the loader itself which is passed. For example this runs correctly in Typescript: loader.onLoad.add((e:PIXI.loaders.Loader) => {}); How do I get information about which object loaded? i.e. for single items being completed, not the whole collection (i.e. onComplete)
  6. dmko

    boilerplate setup

    That's pretty much what I was trying to say... though it brings another point - along with the type of aliasing above, you can do this too: import * as Animals from './animals/Jaguar'; let cat:Animals.Jaguar = new Animals.Jaguar(); It doesn't solve the issue of code-splitting though, which I think might just be contradictory to import style anyway. It seems namespaces in typescript are pretty arbitrary when everything is split into imported modules...
  7. dmko

    boilerplate setup

    "The top-level module here Shapes wraps up Triangle and Square for no reason. This is confusing and annoying for consumers of your module" "Because the consumer of a module decides what name to assign it, there’s no need to proactively wrap up the exported symbols in a namespace." - https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html
  8. Conceptually, I guess you could add a "motion blur" filter... though I have no idea how to implement something like that!! The idea is that you can't change is how often each visual update happens (let's say 60fps) - but you can fake it to trick the human brain. For example, let's say frame 1 it's over here, frame 2 it's over there - but also on frame 2 you have like a little bit of a trail of a faded path between here and there. Sounds like it would be super complicated, but I dunno - maybe there's some easy trickery to it. Unless you're talking about that, ultimately a higher frame r
  9. dmko

    boilerplate setup

    Don't you still need to import it to use it though? To me that's the big distinction - in Unity, if a .cs file exists in the project, it gets imported into the global namespace. With ts, you need to explicitly import it - which means you can have conflicting classes in a "project" as long as you aren't importing them together at the same time. I'm not anti-namespace, I'm just trying to figure out if it's really as necessary to start a project like that from the outset
  10. Opened as an issue @ https://github.com/pixijs/pixi.js/issues/4027\
  11. Thanks... couldn't get it to work though, is just drawing black: https://codepen.io/anon/pen/oWyoxm?editors=0010 (it first paints a bunch of circles in random colors, and then tries to erase every other line - but you can see that every other line just gets painted black instead) I get it's not exactly what you wrote since the alpha pixels would need to be changed to white... but still - the black parts aren't erasing
  12. dmko

    boilerplate setup

    In Unity - you MUST use namespaces to distinguish between classes of the same name, otherwise you get compile ("build") errors, even if you never actually use the conflicting classes Consider this setup: Main.cs Vehicles/Jaguar.cs Animals/Jaguar.cs Immediately, unless you encapsulate those Jaguar classes in a namespace, you get errors- the Unity editor won't let you run it in play mode until you fix it. With Typescript (and I assume ES6 modules) it's different Because you must explicitly import the class, with a the same setup as above (cs=ts) this is fine: import {
  13. I updated the docs to reflect this https://github.com/dakom/html5-boilerplate#external-libraries
  14. In that example repo there's some different libs that work in different ways to test the different situations one may encounter. 1. External vanilla js with no types and loaded only through html pixi-sound has no types, and is only loaded externally. For that reason it must be cast to any at runtime and treated as a vanilla js Object: https://github.com/dakom/html5-boilerplate/blob/master/src/app/game/layers/Worker/WorkerManager.ts#L10 https://github.com/dakom/html5-boilerplate/blob/master/src/app/game/layers/Worker/WorkerManager.ts#L20 A similar example is the Moderni
  15. Ignore the gazillion npm commands, if you take a look at the package.json you'll see the actual devDependencies are pretty tight, especially if you don't want all the karma/mocha stuff. When using typescript, so far, I'm finding no need at all for all the babel stuff for example (and in general - the less moving parts the easier it is to isolate where things go wonky)
  16. http://www.html5gamedevs.com/topic/30317-boilerplate-setup/ I didn't use pixi-extra-filters but did use pixi-sound, I'm guessing same structure applies Sorry it's so verbose, but lots of it is kindof notes to my self (e.g. since posting that I've already made some changes due to stuff that broke when I copied it over to my real project)
  17. I have some code which works just fine, but I'm not sure if there's a better way of drawing lines on the screen with a texture-brush and I also have a question about erasing Here's what I'm doing atm: SETUP Create a RenderTexture of a certain size ("renderTexture") Create a Sprite out of that, and add the Sprite to the stage ("viewSprite") Create a Container, don't add anything to it yet ("drawBuffer") Create an Array (or really object pool "pool") of sprites ("brushSprite") with the current brush texture (and other settings - color, size etc.). ("pool" - unde
  18. If going that route note the point at the end: https://github.com/kittykatattack/scaleToWindow/blob/master/scaleToWindow.js
  19. Alternatively, https://github.com/kittykatattack/scaleToWindow Call like window.scaleToWindow( PIXI.Application.renderer.view), e.g: var app:PIXI.Application = new PIXI.Application(1024, 720, {backgroundColor : 0x1099bb}); document.body.appendChild(app.view); doScaleWindow(); window.addEventListener("resize", doScaleWindow); function doScaleWindow() { window.scaleToWindow(app.renderer.view, 0xFFFFFF); }
  20. dmko

    boilerplate setup

    Truth is I didn't give too much thought to the code itself... other than getting the features I wanted to test working. I'm brand-new to typescript and not too seasoned with JS either (just got myself the "You don't know JS series..." already a few pages in and it's clearing up some misconceptions I had The main thing about this boilerplate is dealing with all the configuration stuff... i.e. getting karma, webpack, mocha, tsc to all play nicely together - and also dealing with a sort of offline/online development scenario for media assets and things.
  21. dmko

    boilerplate setup

    The structure there is all based around typescript (which is part of what made it so infuriating, as getting back to the original .ts files with correct line numbers can be tricky across scenarios)
  22. dmko

    boilerplate setup

    Needed to start a commercial project that's going to be browser based... and though I got by doing some nighttime stuff in the past I needed to force myself to setup something a bit more robust. Hope this helps someone else too! https://github.com/dakom/html5-boilerplate
  23. Very curious about this too... For my current project I attach listeners to the two loaders separately (i.e. follow the counter of each Howl object's onLoad and track when they're all complete) Would be really nice if I could just use the PIXI loader for everything. Note that for visual display purposes, I guess you could load it all with pixi loader, then destroy the load and then setup the Howl stuff which should get it from cache, though that's kindof lame...
  24. Try using the dev branch of PIXI, there was a bugfix which might be affecting this - details @ https://github.com/pixijs/pixi.js/issues/2873 (actually it seems like this commit might have been merged into latest master, so maybe just update pixi from the repository build)
×
×
  • Create New...