3

I was reading this to understand sprites

http://css-tricks.com/css-sprites/

The author says "Sprites are for graphics that are just single blocks. " What does this mean? One thing I have read is to make a sprite for images which are continuous on a web page.

thanks

1
  • Note that the statement only applies to the CSS methods the author is talking about. Tiled backgrounds are in point of fact a single "sprite" of arbitrary size duplicated multiple times. The vast majority of computer game backgrounds are tiled from sprite sheets, but these require a copy or Blt method which is not available AFAIK in CSS, and if it is, it is not advisable IMO.
    – horatio
    Commented May 9, 2013 at 21:21

1 Answer 1

2

It means they cannot be used as a pattern. Take a look at the small print under that paragraph:

*OK, they kinda can do repeating, but it's a little trickier and can only work one-dimensionally (x or y).

So, sprites should be used for graphics that are only displayed once (such as an icon). They should not be used for a gradient pattern intended to be repeated vertically or horizontally and especially should not be used for a tile-able background

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.