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
12
votes
3 answers

How to automatically detect and crop individual sprite bounds in sprite sheet?

Given a sprite sheet like this: I would like to write an algorithm that can loop through the pixel data and determine the bounding rectangle of each discreet sprite. If we assume that for each pixel X, Y that I can pull either true (pixel is not…
Rob Evans
  • 6,750
  • 4
  • 39
  • 56
12
votes
1 answer

Texture Sampling Coordinates to Render a Sprite

Let's say we have a texture (in this case 8x8 pixels) we want to use as a sprite sheet. One of the sub-images (sprite) is a subregion of 4x3 inside the texture, like in this image: (Normalized texture coordinates of the four corners are shown) Now,…
Nicolas Miari
  • 16,006
  • 8
  • 81
  • 189
11
votes
6 answers

Do CSS Sprite images have to have X amount of space between each item?

I am having a problem, for a while I have been trying to figure out how to resolve this issue. I will describe it very well below... I am trying to use an image as a sprite image for an UL list. It should show an icon with text next to it, both…
JasonDavis
  • 48,204
  • 100
  • 318
  • 537
11
votes
4 answers

How to move a sprite with the keyboard keys using libGDX?

i have just started using java and libgdx and have this code, very simply it prints a sprite onto the screen. This works perfectly, and i learnt a lot from it. package com.MarioGame; import com.badlogic.gdx.ApplicationListener; import…
dotty
  • 40,405
  • 66
  • 150
  • 195
11
votes
1 answer

CSS sprite image + background-repeat a part of it

Can I repeat a part of an image [which it's in a CSS sprite image] in the background ?! like for example : background-position : -13px top ; background-repeat : repeat-y ; because I got the whole sprite image repeated ...
Waseem
  • 111
  • 1
  • 4
11
votes
5 answers

Recommended 2D Sprite engine for a Delphi board game?

Which are the choices I should look into for a Delphi sprite engine. I am aware of GLScene Andorra 2D anything else I am missing? It is best if it relies on OpenGL. DirectX only solutions are not very welcome.
Gad D Lord
  • 6,620
  • 12
  • 60
  • 106
11
votes
6 answers

CSS Sprites - not only for background images?

Is it possible to use CSS sprites for "foreground" images -- i.e. images that users are supposed to click on and interact with and maybe even print? Instead of using the CSS background-image property. What would you use?
Summer
  • 2,488
  • 3
  • 23
  • 32
11
votes
2 answers

How to color-fill a black and transparent image in iOS?

For example, in the iOS toolbar, you drag in your own .png which is opaque black and transparent, and it automatically adds the iOS blue gloss. However, I'd like to know how to do this yourself, but just solid colors will do. For example, if you had…
Qiming
  • 1,664
  • 1
  • 14
  • 18
10
votes
1 answer

Using image sprites on android

I have an image (588x449) sprite with a collection of different team logos. In Android I have the corresponding ImageView displaying this:
mattyp
  • 155
  • 1
  • 2
  • 5
10
votes
5 answers

How to import SVG to Unity 2018.2

Unity's roadmap stated that we should be able to import SVG in Unity 2018.2. I have Unity 2018.2.3, but I couldn't use SVGs to Unity. Unity doesn't recognize they are sprites. Please can anyone tell me how to import/use SVGs in unity.
JohnnyPro
  • 118
  • 1
  • 1
  • 8
10
votes
1 answer

Sprite Labels with React-Three-Renderer (MVCE included)

I'm using react-three-renderer (npm, github) for building a scene with three.js. I'm attempting to use and to make a label that always faces the camera, much like in stemkoski's example. However, I'm having trouble getting…
Scotty H
  • 6,432
  • 6
  • 41
  • 94
10
votes
2 answers

Textured points in OpenGL ES 2.0?

I'm trying to implement textured points (e.g. point sprites) in OpenGL ES 2.0 for a particle system. Problem I'm having is the points all render as solid black squares, rather than having the texture properly mapped. I have verified that…
Ivan
  • 177
  • 1
  • 3
  • 7
10
votes
2 answers

How to load and display image in OpenGL ES for iphone

I'm a newbie and trying to display a sprite on my iPhone screen using OpenGL ES. I know its far simpler and easier to do it with cocos2d but now I'm trying to code directly on OpenGL. Is there any simple yet efficient way to load and display sprites…
nomann
  • 2,257
  • 2
  • 21
  • 24
10
votes
2 answers

Nearest Neighbor rendering in Canvas

I have a sprite that animates using a sprite sheet. He is only 16x16, but I want to scale him up to around 64x64 in all its pixel-y goodness! The results are terrible, of course the browser is anti aliasing it. :/ Thanks! EDIT: No css needed,…
DevEarley
  • 221
  • 3
  • 11
10
votes
1 answer

XNA sprite sort mode

What is the difference and consequences of using SpriteSortMode as FrontToBack or BackToFront? It's that with FrontToBack the object that has the smaller layer value will be draw first and with BackToFront the object that has the smaller layer value…
Lucas
  • 3,059
  • 5
  • 33
  • 48