Answer the question
In order to leave comments, you need to log in
Is it possible to make a sprite scalable?
So it goes.
I create sprites with SpriteSmith.
And such a thing: at resolutions from 640 to 320, the layout is fully scalable (all sizes are written in vw), but the sprites remain the same size, always.
In addition, they are made for retina screens.
Is it possible to make the sprite scale as well?
Or will you have to display all the icons in img?
The designer did not provide SVG, so there is no need to write about them.
Answer the question
In order to leave comments, you need to log in
Raster scaling is a bad idea. However, if there is a need, then you need to set the background-position for the icons as a percentage. SpriteSmith, judging by a cursory examination, does not know how to do this, so you have to fork or calculate the percentages yourself.
UPD: You need to change the background-position and background-size, of course. background-size is better to change in pixels.
UPD2: I looked again, you can not take a steam bath, modify result.coordinates.
result.coordinates.x = (result.coordinates.x / result.properties.width) * 100;
result.coordinates.y = (result.coordinates.y / result.properties.height) * 100;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question