Comments (2)
Disable drag event on all shapes accept one shape.
You'll need to implement your own dragging system using engine events, it should be easy to make your own based on MouseConstraint.js.
How to create custom shapes. In my case I have to create "C" like random shapes
I assume you mean concave shapes, if so these are not currently supported see issue 15.
You can create any convex shape you need by passing the vertices to Body.create
, for example this is a triangle:
Body.create({
vertices: [{ x: 0, y: 0 }, { x: 25, y: 50 }, { x: 50, y: 0 }]
});
from matter-js.
I hope this helped you solve your issue, so I'm closing this for now. Feel free to comment if you have further questions.
from matter-js.
Related Issues (20)
- Why might there be such an error? HOT 1
- Simple Polygon Physics Issues HOT 1
- How to add project to the Wiki gallery ?
- How to scale the world? HOT 2
- [Phaser 3] Position of matter sprite's image not correct in container HOT 1
- loss of sprite quality on mobile HOT 1
- `Composite.translate` didn't move the bodies included
- Create Matter.Bodies.fromVertices with rounded vertices
- MouseConstraint preventing clicks on buttons on mobile. HOT 3
- Vulnerability related to the formula of universal gravitation
- Body with high mass and low inertia behaves erratically
- The startdrag event of dragging a body does not trigger after losing focus.
- How to move camera in matter.js world? HOT 1
- How to use matter.js on a web worker?
- Moving objects penetrate each other. HOT 1
- How to remove the opacity change while using isSleeping option true? HOT 2
- Is it possible to implement sprite looping animation?
- How to increase sprite quality? HOT 1
- Circle and svg in one body
- Converting gyroscope values consistently across Android and iOS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matter-js.