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
1
vote
0 answers

Unity 2D : Does having smaller sprite size improve performance?

I have recently started working on a 2d project in unity 2d it's aimed at android/ios devices. I have loads of sprites that need to be displayed at once on one screen and I can use one of the following sizes 256x256, 128x128, 32x32. is using smaller…
user8445415
1
vote
1 answer

How to get both colliding sprite objects in pygame?

If a collision occurs, is there a way to get both objects? For example: allSprite = pygame.sprite.Group() Bullets = pygame.sprite.Group() Enemies = pygame.sprite.Group() bullet = Bullet() enemy = Enemy() Bullets.add(bullet) Enemies.add(enemy) hits…
Knight
  • 23
  • 6
1
vote
2 answers

pygame/python wont detect collision between sprites

im trying to detect a collision between pacman and the boxes, but its not detecting any collision, any help or advice? at the moment ive tried creating a list of instances but that hasnt worked, i dont know what else to do. also its telling me to…
cdd
  • 109
  • 11
1
vote
1 answer

Pygame: strange behaviour of a drawn rectangle

I'm trying to make a lifebar class for my game in Pygame. I've done this: class Lifebar(): def __init__(self, x, y, max_health): self.x = x self.y = y self.health = max_health self.max_health = max_health def…
HastatusXXI
  • 101
  • 9
1
vote
2 answers

Unable to Animate Sprite in Phaser.js

I am trying to use a sprite sheet to move a character around with the arrow keys, but it doesn't seem to be working. If I set the background to be larger than 500, 500, the screen will move around along with the character, but I want the character…
hannacreed
  • 639
  • 3
  • 15
  • 34
1
vote
0 answers

sprites compass - cannot resolve import

The image with sprites appeares in my images folder, but in SASS file I have an error with @import "icons/*.png"; as cannot resolve import to SASS/SCSS file. And in @include all-icons-sprites; there is an error as cannot find mixin…
atanyday
  • 87
  • 1
  • 9
1
vote
0 answers

Transparency with SpriteNodeMaterial

I started from the example https://threejs.org/examples/#webgl_sprites_nodes to have the animated sprite feature thanks to the SpriteNodeMaterial. The first thing I wanted was to have the background of the sprite transparent, I updated the .PNG…
Gnervey
  • 23
  • 5
1
vote
2 answers

Can we visualize the embedding with multiple sprite images in tensorflow?

What I mean is, can I, for example, construct 2 different sprite images and be able to choose one of them while viewing embeddings in 2D/3D space using TSNE/PCA? In other words, when using the following code: embedding.sprite.image_path =…
I. A
  • 2,252
  • 26
  • 65
1
vote
1 answer

iPhone - Should I composite two images at runtime, or pre-render them at the cost of memory

I am building a cocos2d iPhone game. There will be 6 'enemy spaceship sprites' that vary only by colour. I.e. all the sprites will have the same shape only some parts of the interior will have different colours. My two options are: 1) Create a…
Robert
  • 37,670
  • 37
  • 171
  • 213
1
vote
1 answer

Pixi.Texture, get height and width

Im trying to get the width and height from the texture of a sprite. The properties should be available according to the documentation, and when when doing console.log(texture) they are correct, but when doing console.log(texture.height) it always…
anton petersson
  • 143
  • 1
  • 1
  • 9
1
vote
2 answers

resize issue in the animator with sprite sheets - unity 2d

I have a character that i'm trying to resize. I have put the default idle animation sprite right next to the larger sprites in the sprite sheets for consistency. when i put in the larger sprites in the animation window (separate animation from the…
1
vote
1 answer

Resizing a sprite by adding transparent pixels

The reason I wish to do so is that Unity has a nice DTX5 format that reduces the file size by a lot. But to get that, I need a sprite that's size is - both for height and width - a multiple of 4. So I thought I create a new texture with the desired…
agiro
  • 2,018
  • 2
  • 30
  • 62
1
vote
1 answer

Efficient way to do static animation with LibGDX?

Doing simple platformer game with LibGDX and Android. For me not a problem to do an animation with sprite sheets but I'm wondering about efficient way to do "static animation for map elements"... for example: stars on the sky moving grass moving…
Lugaru
  • 1,430
  • 3
  • 25
  • 38
1
vote
0 answers

svg sprite load with webpack and react

Hi I am using svg sprite I created using icons8 website for all my website icons, and the icons are working but it seems that the website loads them more than once per page (if i open the network tab i can see it loaded twice or more). I have been…
Omry Rozenfeld
  • 125
  • 2
  • 8
1
vote
1 answer

Make Infinite Obstacles Moving to the Left in a SpriteKit Game

I have a SpriteKit game with a ball that can be thrown and dragged. When it is thrown, the SKCamera follows it. What I want is shown in the picture below: How can I build this kind of obstacle?
Josh Schlabach
  • 401
  • 5
  • 17