Jump to content

peterje

Members
  • Content Count

    15
  • Joined

  • Last visited

  1. 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.
  2. 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.
  3. 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
  4. Thanks for answering all my noob questions Ivan. Why won't npm work?
  5. 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
  6. For anyone who finds this, you should use This repo. It is exactly what I needed!
  7. 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?
  8. 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?
  9. 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
  10. 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!
  11. Do you have any examples you can point me to?
  12. 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!
  13. Hi Pixi Devs, First post here. This issue has plagued me for days. My PIXI project requires Sprites to update their scale "on the fly". I need this to work with minimal quality loss. My goal is to get an effect like Scratch has obtained. At multiple different sizes, the texture quality remains perfect. I know Scratch uses SVGs for the perfect resolution but that has been a nightmare in PIXI. According to the Scratch Source Code, the SVGSkin class uses an array of 8 MIPS that can be hot swapped as the size is modified. How could I implement this in PIXI? Further, how does an array
×
×
  • Create New...