Questions tagged [sprite]

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

sprite
Filter by
Sorted by
Tagged with
3 votes
1 answer
294 views

Fabricjs: Sprite sheet to horizontal continuous video thumbnail on canvas

I have multiple sprite sheets, one for each minute of the video. For example if video is 3 min long I have sprite.0.jpg, sprite.1.jpg, sprite.2.jpg which mean 3 sprite sheets each having 60 images for ...
Yogesh Yadav's user avatar
3 votes
1 answer
42 views

Null pointer exception error as method parameter

I am using two sprites as parameters for a method but I am getting a null pointer exception error. Here is my code. The errors are in the checkCollision method. I was trying to declare the parameters ...
Sam King's user avatar
3 votes
1 answer
861 views

How do I make an object in pygame rotate

I am making a game, and previously had made it using images and bliting them but I am now remaking it trying to uses object and sprites. I am unsure how I would make my image and rect rotate and I am ...
Harley Welsh's user avatar
3 votes
3 answers
44 views

Difficiating objects in a group

In a group called powerUpGroup, there are two objects: speedUp and jumpUP. The following code checks if the player object has collided with any objects in the group: for eachPowerUp in powerUpGroup: ...
Daeshaun Morrison's user avatar
3 votes
3 answers
351 views

PYGAME: Collision is not working properly. The player and platform are not behaving well. Help, newbie to python here

this is my first question in stackoverflow. I started learning python 3 months ago, and I'm building a platformer game using sprites. I had to isolate the problem, so I'm only posting the part where ...
Tom's user avatar
  • 61
3 votes
2 answers
257 views

How do I set a limit to the range of my bullet?

My game has a sprite which can move left and right and shoot bullets. However, if I shoot out too many bullets (about 50 or so), my game starts lagging a lot. My sprite doesn't move fluently anymore ...
M3lon_sauc3's user avatar
3 votes
1 answer
245 views

pygame sprite appears to stretch/grow instead of move along x-axis

What I'm trying to do is make a green box that moves along the x-axis of the screen. This is what the online tutorial tells me to do: class Player(pygame.sprite.Sprite): def __init__(self): ...
Ethan Dole's user avatar
3 votes
1 answer
1k views

Pygame: How do I slowly fade and kill a sprite?

When I run this code sprite.spritecollide(a,group,True) the sprite is removed from the screen. But it disappears instantly. How do I apply a fading effect to it? I want it to slowly fade out before it ...
Nuh Yamin's user avatar
  • 343
3 votes
2 answers
3k views

Flipping an enemy sprite when he turns around in Unity

I'm some hours already trying to solve this, I tried many ways but none of them worked... So I have an enemy that follows the player using an AI and I need the sprite to flip when the enemy turn left ...
Caíck's user avatar
  • 43
3 votes
1 answer
935 views

What is a high performance way of splitting up Sprite Sheets/ Chip Sets in JS?

I'm working on a 2d world editor for html/js, and trying to find the best way to split up a chip set (as seen below) into multiple little squares (chips). Currently, I'm using a method similar to the ...
Seph Reed's user avatar
  • 9,722
3 votes
1 answer
3k views

How to collide with custom sprite bounds in Phaser

I have a file pickle.png with a custom hitbox in a pickle.json file like this which I created using PhysicsEditor. { "pickle": [ { "density": 2, "friction": 0, "bounce": 0, ...
max pleaner's user avatar
  • 26.4k
3 votes
1 answer
11k views

LibGdx collision detection between sprites?

Using accelerometer my sprite image is moving left and right and if I touch my screen the sprite is moving to Y-axis.I want to make a collision detection between different sprites so that if the ...
user avatar
3 votes
2 answers
5k views

How to keep sprite border the same size when scaling sprite in Unity?

I've created an image in Photoshop to be used as a sprite in Unity and everything works fine while the sprite is scaled at X: 1; Y: 1. The problem starts when I scale the image up as the border of ...
Josh's user avatar
  • 33
3 votes
2 answers
587 views

Optimize SVG and create SVG sprite - ruby middleman

I'm running a middleman application which is based on ruby. I have a folder full of SVG files I need to optimize them in order to create an SVG Sprite out of them. I'm searching for gem that does ...
mhyassin's user avatar
  • 134
3 votes
1 answer
198 views

Is there a better way to move a sprite using the keyboard with Pygame?

Currently, I have small image that I move using the D and A keys on the keyboard. The code works just how I want it to, but it seems to be a bit unnecessarily complicated. Is there a more efficient ...
dominikm's user avatar
3 votes
1 answer
2k views

How to call functions from sprites in groups?

I have a Sprite class that I have but in a group. Every time the mouse button is clicked I want to call a function from the class. The function should be called for every item in the group. I only ...
Hendrik Eerikson's user avatar
3 votes
1 answer
3k views

Using Pygame, draw a copy of an image in a different location

This is kind of a follow up to this question: Note: This in python, using the pygame library. I'm wanting to get some clarification on this statement which is a comment from the above question: ...
kBeezee's user avatar
  • 48
3 votes
1 answer
2k views

Moving Shape via Mouse in Opengl

void Rectangle(void) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_QUADS); glColor3f(1.0,0.0,0.0); glVertex2f(m_x-0.25,m_y-0.25); glColor3f(1.0,0.0,0.0); glVertex2f(m_x-0.25,m_y-0.75); ...
user3059066's user avatar
3 votes
1 answer
455 views

How to divide sprite into smaller parts in pygame?

No i don't ask about spritesheets. I'm working on a game in pygame and I want to know if it's possible to divide sprite into parts like body parts and then use it in collision-detection with pygame....
NetSec's user avatar
  • 85
3 votes
2 answers
2k views

How to send smaller images to mobile browsers (eliminate large data requests)

When designing a responsive web page, we obviously want images that are larger on larger screens and smaller on smaller screens. It seems like there are many ways to accomplish this so I am wondering, ...
Startec's user avatar
  • 12.9k
3 votes
1 answer
4k views

Update text inside `THREE.Sprite` with ThreeJS

I created a sprite object which contains text inside using the context.fill method. However, I'd like to change the text so that it displays a distance that I have calculated in the 3D canvas. I do ...
Yenza's user avatar
  • 446
3 votes
1 answer
1k views

iOS Sprite Kit Collision with movement through elements

Is it possible to use Sprite kit's physicsBody to have element collision and still allow elements to go through each other? I'm interested in having the delegate to be called only when two borders hit ...
eagle's user avatar
  • 99
3 votes
1 answer
1k views

LibGDX guidance - sprite tracing 2D infinite random bezier curve

I've been able to apply a smooth animation to my sprite and control it using the accelerometer. My sprite is fixed to move left and right along the x-aixs. From here, I need to figure out how to ...
jdubbing's user avatar
3 votes
1 answer
3k views

WPF spritesheet animation

I am trying to create an animated sprite from a spritesheet in wpf. The current technique I am using is breaking down an image of containing all the frames of the animation into separate images and ...
Damir Bojan's user avatar
3 votes
1 answer
1k views

Libgdx blending textures based on specific colors?

To explain this problem in a simple way, imagine three 16x16 terrain tiles: one full sand, one full grass, and one transition of sand and grass. After creating the map, I'd like to overlay a larger ...
ant-depalma's user avatar
  • 2,036
3 votes
1 answer
2k views

Android / Offscreen rendering to texture

I am making a 2D graphical app that will display planets. I say 2D because the majority of the app will be 2D. I however want to render some 3D objects into dynamic sprites offscreen (to a texture), ...
user2255673's user avatar
3 votes
1 answer
1k views

Background image taking too long to draw (Canvas) Jerky Sprites......?

Hey all I'm at a crossroads with my app that I've been working on. It's a game and an 'arcade / action' one at that, but I've coded it using Surfaceview rather than Open GL (it just turned out that ...
Zippy's user avatar
  • 3,858
3 votes
1 answer
887 views

Layered Sprites With Predetermined Offset / Rotation

Probably not a very descriptive title, but I'm doing my best. It's my first time posting on StackOverflow, and I'm relatively new to programming in C# (first started around a year ago using Unity, ...
Roy Ermak's user avatar
3 votes
3 answers
174 views

Need a way to "flip" this char array for a game sprite to look to the left

So, basically I need to find a good way to "flip" a char array used for a sprite in order to make him/it look to the left and vice versa. Here is my array -> WARRIOR = ( " " + "!!!!! "...
Anwar's user avatar
  • 81
3 votes
1 answer
3k views

ANDROID ANDENGINE -- change sprite on action down

I have in my app some sprites. When I touch a sprite (in TouchEvent.isActionDown() ) , I need to change its image How can I made this?
NemoPhobia's user avatar
3 votes
2 answers
391 views

How to move 2 xna sprites away from eachother dynamically?

I have two items, lets call them Obj1 and Obj2... Both have a current position pos1 and pos2.. Moreover they have current velocity vectors speed1 and speed2 ... How can I make sure that if their ...
JML's user avatar
  • 951
3 votes
1 answer
542 views

Spawn sprite at different intervals

Forget the previous one if you seen it. public void createNormZomb(){ normZombie.add(createSprite(R.drawable.zombie1)); normZomb.postDelayed(this, 1000); ...
steven's user avatar
  • 698
3 votes
2 answers
544 views

Actionscript 3: color effects under DisplayObject

I have a DisplayObject (let it be a Sprite). What I need is to make content under it black-and-white (only within its borders). Any suggestions? Thanks.
Timofei Davydik's user avatar
3 votes
5 answers
6k views

Bounding box collision handling - not detection

I had this working a week ago, but then I ended up breaking it. I can't get it working again. I have some 2D sprites, they're just rectangles. No rotation involved. I'm not looking for a way to detect ...
Tesserex's user avatar
  • 17.3k
3 votes
1 answer
252 views

Check if object is all painted

I have a brown sprite, which contains a hole with triangular shape. I've added a trail renderer (and set its order in layer to appear behind the sprite), so the user can paint the sprite's hole ...
Daniel's user avatar
  • 7,575
3 votes
1 answer
311 views

Sprite Texture not dividing the pieces from the image C++

Good day, I am trying to create a chess game from scratch using SFML the problem I am having is I end up with the picture attached below instead of having the chess piece by piece. right now I am not ...
Sohaib Aljey's user avatar
3 votes
1 answer
65 views

Sprites appearing too fast

I'm trying to create a program where balloons appear for the user to pop, however balloons are appearing so fast it becomes unmanageable. I took a screenshot about half a second into running the ...
Nico's user avatar
  • 101
3 votes
2 answers
946 views

Good practice for using almost identical sprites in phaser. Alternatives to using more sprites

So, I have been working in Unity but I've decided it's time to change to something I know better: JavaScript. I've been considering switching to Phaser.js but I have some questions regarding an issue ...
Stefan Octavian's user avatar
3 votes
1 answer
505 views

Sprites not showing in Pygame

I'm not sure what I am doing wrong here. There are no errors appearing but when the game loads nothing appears, just the black background. This is the code that I am running for loading my sprite into ...
S V's user avatar
  • 31
3 votes
1 answer
479 views

Exception using sprite with pyganim

Good day. I'm trying to write a platformer. Basic actions like creating a map, creating a character, interaction and camera movement are already implemented. There are 4 files: Game.py: Responsible ...
Максим Куликов's user avatar
3 votes
1 answer
4k views

Phaser sprite animation won't play

I have some sprite animations that won't play and I can't understand why. I'm using the latest version of Phaser, but not the community edition. I want to go from frame 1 to frame 0 when I turn left ...
Davtho1983's user avatar
  • 3,897
3 votes
1 answer
200 views

In swift, is there a way to select a sprite by its name?

I'm new to coding in Swift so I apologize if this is a silly question. I have a function that creates a series of Sprites. These Sprites move around and change sizes. Through the function, each is ...
user7299543's user avatar
3 votes
1 answer
363 views

Nodes position within scene size

In my SKScene, I am making a simple space shooter game. How can I make sure that my enemies always appear within the screen size regardless of which iphone the game is played at? In other words ...
Osaama Shehzad's user avatar
3 votes
1 answer
1k views

Assigning an image to a SKShapeNode as a Ball - Spritekit Game

I am trying to add an image to my ball in my Swift 2 Sprite-kit game. I have a make() ball function and it there are no errors there however in the game scene, when the method is called, I keep ...
N. Howey's user avatar
  • 119
3 votes
1 answer
4k views

How to create an array of SKSpriteNodes using Swift?

I've designed my program so that each time the user touches the screen, the sprite's image and position changes. I want to be able to make an array of SKSpriteNodes. I've seen a similar post, but they ...
codeherk's user avatar
  • 1,629
3 votes
2 answers
4k views

Too slow switching for android in Unity3D

My game has 1000+ frames and format of sprites is Crunch because of too many sprites in this project. when I want to switch it from windows to android it takes me almost 1 day to switch (actually I ...
ATHellboy's user avatar
  • 704
3 votes
2 answers
3k views

Unity - best way to change the shape of the gameobject at runtime

I want create a simple 2D game in Unity3D, in which one of the entities has to grow and shrink. This is done by merging simple shapes. A rough example in the picture below just to show what I mean: ...
Raj Alahmar's user avatar
3 votes
1 answer
87 views

Movement in 2D Games (round position when blitting?)

I use Python 2.x and Pygame to code games. Pygame has a built-in rect (Rectangle) class that only supports ints instead of floats. So I have made my own rect class (MyRect) which supports floats. Now ...
Don Polettone's user avatar
3 votes
1 answer
956 views

Automated CSS Sprite of svg files phpstorm

I am looking into the best way to serve images. I think svg files and sprite is the best method iv found, I wanted to know if there is way to automate this process. I want to be able to put svg files ...
Mokky Miah's user avatar
  • 1,303
3 votes
2 answers
16k views

How can I programmatically load a texture into an Image the same way the Unity Editor does?

In the image above, the first image is loaded via C# script. The second is assigned via the inspector in Unity editor. Note the dark gray border around the first image. How can I load the image via ...
Stafford Williams's user avatar

1
7 8
9
10 11
96