Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Hi devs, In my project I have a number of GameObjects, each of which have a sprite attribute which is a derivative class of Pixi.Sprite. That doesn't really matter but just some background. Here's the issue: public startGame(): void { this.running = true this.app.ticker.start() for (const go of this.gameObjects) { go.sprite.dragDisable(); go.sprite.start() this.app.ticker.add(go.sprite.update, go.sprite) // this is the problem } } It is important that I can pass in go.sprite in as a context! Each of my sprites have an
  2. I went and learned how to do matrix math again and now it works I ended up just using the transform my sprite to transform my points! actually so simple if you dont try to stitch together 50 libs.
  3. Yeah I used https://github.com/chrvadala/transformation-matrix#transform Affine Transform library. Translating my points works fine but using the scale matrix did not... It looks something like this after transforming each point of my shape by an affine scale matrix: I think it is because each polygon needs a different reference point to scale from. At first they were all scaling with (0,0) as a reference point but that didnt work. I tried using the centroid of each polygon as a reference point but that did not work either.
  4. This question is not strictly PIXI related but I hope someone here would be able to provide some insight. In my project I am attempting to create accurate collision detection for PIXI sprites. So far, I have taken a sprite and deconstructed it into convex polygons like so: The paths of these polygons are stored like so: These points represent the paths of all 12 polygons in the balloon. I am using https://github.com/davidfig/intersects to detect collision between two sets of these polygons. It is the simplest library I could find. Pretty mu
  5. Thanks for answering all my noob questions Ivan. Why won't npm work?
  6. Currently, the Sprites in my game only have rectangular collision detection, but more complex shapes for their hitArea. This makes drag & drop very nice but I am wondering if the same is possible for collision detection. Somehow, Scratch has this ability. As shown here, even for shapes where a hull would not be very good, the collision detection is still perfect. Anyone have an idea if this can be done in PIXI? Or am I just limited to rectangular collision detection? For example, a sample sprite I have looks like this: And the hitArea I generated looks like thi
  7. For anyone who finds this, you should use This repo. It is exactly what I needed!
  8. Thanks. Not sure what PhysicsEditor is..not much comes up when I search for it. Is it a tool separate from PIXI? Also, what is the point of the hull if the bounds will always be rectangle. Does this mean I can't have better collision detection than AABB?
  9. In a project I am working on I wish to have bounds for my display objects be more accurate than a rectangle. For example, this balloon sprite currently collides with everything in its default AABB bounds. However according to the documentation I can override calculateBounds and define a hull for this object. How might I go about that for a large collection of sprites I have stored as a PNG? Do I have to manually map out the hull for each sprite or is there a built in algorithm to do this for png with transparent backgrounds?
  10. I am building a Scratch-like application in Vue with PIXI as my rendering engine, but I am having trouble getting my WebGL view to stay within its parent container. Here is what my web page looks like before I add the canvas. The empty white area with id=canvasWrapper is where I want to put my canvas. <template> <v-container class="pa-0 flex-grow-1 d-flex flex-column"> <v-sheet rounded color="white" class="flex-grow-0 mb-2 py-1 d-flex align-center justify-space-around" > <v-btn
  11. Bump @ivan.popelyshevI dont really need a demo if you are too busy but if you know of a public codebase that uses this technique I would appreciate it!
  12. Do you have any examples you can point me to?
  13. Thanks Ivan! Just the person I was hoping to hear from. I'll look into everything you talked about but I would love to see a little demo some time. Thanks!
  • Create New...