How could you draw repeating backgrounds on this sprite?

It looks like Amazon uses (uses) a sprite with static backgrounds as well as tiled ones, but they are mixed in which there seems to be no structured position. In general, I understand that if you want to repeat-x on a sprite with static backgrounds, they should all be the same width, or at least the width of the repeating image should be 100% the width of the sprite canvas.

This sprite is from Amazon: http://farm4.static.flickr.com/3320/3217540317_0f0ffb778d.jpg

The lower right area is the gradients that ask for repeat-x.

I can not understand. Ideas?

- Sean

+4
source share
2 answers

The ban on the use of Javascript (which I cannot imagine for a simple solution), I do not consider it possible to do what you ask for (i.e. repeating only part of the complex sprite for the background element.)

I looked at the Amazon website and I could not see that these β€œgradients” are being used. It is possible that this is a β€œspacer” graphics or color information stored in the sprite for future modifications to the image.

...

It would be a great feature to implement, though ... hide the backgrounds, with coordinates denoting the tile area.

+3
source

As far as I know, I do not think you can use this sprite.

You can use sprites to create a repeating background, but the sprite should work with a repeat background. Therefore, if you want to repeat-x, then there must be a vertical sprite and a horizontal sprite to repeat-y (or vice versa). I am always confused with them.

0
source

Source: https://habr.com/ru/post/1336409/


All Articles