You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys. I'm using matter.js for some small animation. Depending on the width of the screen, I render four different options for filling the canvas from prepared objects with a fixed width and height of the elements.
const createElement = (x, y, width, height, img) => { const el = Bodies.rectangle(x, y, width, height, { render: { sprite: { texture: img, }, }, }); Composite.add(engine.world, el); };
...some code...
const respawn = (width) => {
if (width >= 1200) {
elementsRespawn(desktopElements);
} else if (width >= 700) {
elementsRespawn(tabletElements);
} else if (width >= 500) {
elementsRespawn(mobileXlElements);
} else if (width >= 320) {
elementsRespawn(mobileSmElements);
}
};
I have the following problem. On desktop everything is fine, but on mobile all the images are blurry. It's as if they or canvas have scale.
What do I need to work with?
Thank you.
The text was updated successfully, but these errors were encountered:
Hi guys. I'm using matter.js for some small animation. Depending on the width of the screen, I render four different options for filling the canvas from prepared objects with a fixed width and height of the elements.
const createElement = (x, y, width, height, img) => { const el = Bodies.rectangle(x, y, width, height, { render: { sprite: { texture: img, }, }, }); Composite.add(engine.world, el); };
...some code...
I have the following problem. On desktop everything is fine, but on mobile all the images are blurry. It's as if they or canvas have scale.
What do I need to work with?
Thank you.
The text was updated successfully, but these errors were encountered: