Questions tagged [sprite]

A sprite is a two-dimensional image or animation that is integrated into a larger scene.

Sprite

A sprite is a two-dimensional image or animation that is integrated into a larger scene.

Spriting

The term is also used when taking subsections of a larger image file containing icons for display. This allows browsers to load only one image file and reuse it to display many icons by using offsets. This is known as spriting.

FAQs

Resources

4792 questions
16
votes
3 answers

Are image sprites actually more efficient than separate images?

I started using image sprites around 2 years ago because I saw sites such as Apple and Facebook using them on their sites. It goes without question that loading a page is faster if you download one 60kb image, instead of three 20kb images, however,…
Ben Carey
  • 16,540
  • 19
  • 87
  • 169
15
votes
5 answers

Flipping a 2D Sprite Animation in Unity 2D

I've got a quick question regarding 2D Sprite animations that I haven't been able to find specifically answered anywhere: I have a sprite with walk animations to the right. However, I obviously want to flip the animation to the left when he walks…
Jestus
  • 623
  • 2
  • 9
  • 25
15
votes
7 answers

Is there a 2d sprite library for webgl?

I am looking to build a 2d game using WebGL. I want the hardware acceleration that WebGL provides and I cannot get this from the 2D canvas context in the canvas tag. With that said, is there a tutorial on creating 2D sprites using webGL? Or,…
Devon
  • 5,786
  • 5
  • 38
  • 46
13
votes
1 answer

How to preload svg sprites?

I have a svg sprites file icons.svg like this:
Jesús López
  • 8,338
  • 7
  • 40
  • 66
13
votes
4 answers

Getting the width of a sprite

I am trying to create a row out of some square sprites I have. So to get the width of these sprites i am using tileWidth = (int)tileSet[0].renderer.bounds.size.x; And then to form the row i am uisng for(int i = 0; i < tileSet.Length ; i++){ …
Vaibhav
  • 703
  • 1
  • 7
  • 18
13
votes
6 answers

How to remove gaps between tiled textures?

I'm using LibGDX to make a platformer. I'm using square tiles for the platforms but when they are drawn some of them have gaps between them. When I zoom in/out or move the camera around the gaps move position. More details: Tiles are 32x32 and I…
user2291015
  • 131
  • 1
  • 4
13
votes
3 answers

Best practices: efficient sprite drawing in XNA

What is an efficient way to draw sprites in my 2D XNA game? To be more concrete, I have split this question up into 4 questions. I used to declare Game1's spriteBatch static, and called SpriteBatch.Begin and .Close in every IDrawable.Draw. That…
Rudey
  • 4,717
  • 4
  • 42
  • 84
13
votes
4 answers

How to use sprite groups in pygame

So I've gotten to the point in my program where I need to create a group for some sprites that the player can collide with without dying (like some other sprites I may have on screen). I've scoured Google but it appears that the official pygame…
user161592
  • 358
  • 1
  • 2
  • 12
12
votes
4 answers

CSS Sprites browser rendering

We all know that CSS sprite images are great to reduce the amount of requests and such, but what about the performance of the browser rendering the page with several elements using a big image as a background?
Bernardo Botelho
  • 686
  • 5
  • 15
12
votes
1 answer

Firefox and Chrome stops displaying my sprite after 655 images

the problem Hi, i'm working with sprites and got some interesting behavior of firefox and Chrome. When my sprite have 655 images or less, my sprite works fine. But when it goes furter (656 or more) it doesn't get displayed (just become invisible).…
Hugo Mota
  • 11,200
  • 9
  • 42
  • 60
12
votes
1 answer

The Image Optimization Framework was not initialized

I am having this error The Image Optimization Framework was not initialized. Verify the sprites directory exists. After creating the directory, restart the site or application. The error is in this method…
k-dev
  • 1,657
  • 19
  • 30
12
votes
1 answer

How to un-anti-alias a sprite background image ENLARGEMENT in Microsoft Edge?

Examine the problem in the three figures below. I want to expand what already works perfectly in Mozilla FireFox and Google Chrome, to work perfect in Microsoft Edge, too. Mozilla FireFox: Google Chrome: Microsoft Edge: I want a deliberatly…
Sam
  • 15,254
  • 25
  • 90
  • 145
12
votes
1 answer

What is causing this card to change dimensions? [Video & Code]

I am programming a board game in Starling (Action Script 3). The Starling version that I am using has a class called Sprite3D, which allows me to conveniently and easily code the flipping of the cards used in this game. I am troubled by the fact…
Jared Clemence
  • 1,062
  • 11
  • 26
12
votes
5 answers

NES Programming - Nametables?

I'm wondering about how the NES displays its graphical muscle. I've researched stuff online and read through it, but I'm wondering about one last thing: Nametables. Basically, from what I've read, each 8x8 block in a NES nametable points to a…
Jeffrey Kern
  • 2,024
  • 20
  • 40
12
votes
1 answer

Combine Array of Sprite objects into One Sprite - Unity

I have an array of Sprite objects in Unity. Their size vary depending on the image loaded. I want to combine them side by side like a tiled map into one image. I want them to be layout like your are forming a line of images, one after the other.…
cessmestreet
  • 2,298
  • 3
  • 22
  • 42