-
Notifications
You must be signed in to change notification settings - Fork 7.1k
scaleX then scaleY lead to matterjs shape error #4206
Copy link
Copy link
Closed
Description
Version
-
Phaser Version: 3.15.1
-
Operating system: ubuntu
-
Browser: All
Description
When a Matter.Image, configured with a physic shape, is scaled on X then on Y or vice versa, the shape become distorted.
It seems that the second scale apply again the first one.
class Actor extends Phaser.Physics.Matter.Image {
constructor(scene, x, y, texture) {
super(scene.matter.world, x, y, texture, 0, {
shape: scene.fixtures[texture]
});
// ....
}
let gem = new Actor(this, 100, 400, 'Gem Blue');
gem.scaleX = 0.5;
// here everything is ok
gem.scaleY = 0.5;
// here the shape x is resized againgive that (with debug mode activated) :
turn around
Use setScale(0.5, 0.5) instead.
words
Many thanks to Phaser and matterjs teams that give us so valuable tools.
Cheers.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

