Why is the image of Spine Player 3.8 very clear when viewed on a computer, but a bit blurry when viewed on a mobile phone
The image on the phone is a bit blurry
Spinebot The image resources are all the same, and there is a blurring problem in version 3.8, but it is very clear in version 4.2
3.8 did not take into consideration device pixel ratio. We won't patch it since it's a very old release, but you can do that by yourself.
Look at the first lines of code in the resize
method in this file and compare it to the same file in 4.2
As you can see we have in 3.8:
let canvas = this.canvas;
var w = canvas.clientWidth;
var h = canvas.clientHeight;
While in 4.2:
let canvas = this.canvas;
var dpr = window.devicePixelRatio || 1;
var w = Math.round(canvas.clientWidth * dpr);
var h = Math.round(canvas.clientHeight * dpr);
If you apply the same modification, you should get the same result of 4.2.
Davide
After modification, the width and height of the canvas will become super large
Any chance you could share your actual code? Without seeing it, I can only make guesses.
By any chance, did you set a width
or max-width
for your HTML container, like in our official examples?
Davide It has been successful, but the reason is that other plugin versions are conflicting. Thank you very much