Questions tagged [sprite]
A sprite is a two-dimensional image or animation that is integrated into a larger scene.
4,789
questions
-1
votes
0
answers
40
views
Collision information between a part of a sprite mask, not the entire sprite or the rect [duplicate]
I'm looking to see if there is a way to either 1.) return what part of a mask was involved in a collision or less ideal 2.) Create multiple masks on a single sprite Object (i.e. left third, middle, ...
0
votes
1
answer
5
views
'ticker' is deprecated and shouldn't be used. Will be removed in Flame v1.9, use createTicker() instead
Warning of deprecation :
package:flame/src/sprite_animation.dart SpriteAnimationTicker ticker()
Containing class: SpriteAnimation
Returns a new instance of SpriteAnimationTicker
ticker() method is ...
-1
votes
0
answers
13
views
Can you use sprites for collisions? [duplicate]
My Block_collisions methood does not run, and i'm not sure if the code that will cheack if a collision under the block is correct.
My Level script
`class CustomTile(pygame.sprite.Sprite):
def init(...
0
votes
0
answers
16
views
Sprite sheet in Unity2D URP compressing too much?
Im using URP on unity2d. I managed to set up a good color swap thing for one of my sprites. So I can change all of the colors individually to anything I want.
But I need animations on this sprite and ...
0
votes
0
answers
19
views
Get Position on Texture2D via Mouse Position [closed]
I have a Texture2D and I would like to get the specific pixel via a mouse click on a certain position on said Texture2D. I wrote this code for it:
mTexture.GetPixel((int)Input.mousePosition.x, (int)...
-1
votes
1
answer
21
views
Change a specific color on a Texture2D to another color
I am very new to texture manipulation so please forgive me for being too naïve on this.
I want it that when the player clicks a pixel color, it would change the all the pixels that has the same color ...
0
votes
3
answers
67
views
How do I use the icon from the .svg sprite directly in the CSS/SCSS?
a customer is swearing and demanding that by 2023 standards I use all icons inside the svg file. And icons both for background images and for normal icons that can be changed.
I am using an svg sprite ...
1
vote
0
answers
25
views
why won't this draw on the mapcanvas
I have no idea this this.canvas.getContext("2d").drawImage in the map function will not draw, It seems to be creating the canvas but just on drawing on it, it also does log all the numbers ...
0
votes
0
answers
15
views
My Sprite Shape profiler is not working correctly
I am currently making a game replica for practising game development, but while trying to make a close sprite shape, I encountered this problem. I think I did everything right but I don't know why is ...
1
vote
1
answer
49
views
How can I combine all child sprites into a single sprite?
I have a scene that consists of one parent and several children, which are all Sprite2Ds, like "Body", "Clothes", "Armor", etc. I want to be able to refer to the parent ...
0
votes
0
answers
12
views
How do i load spritesheet in the middle of my canvas?
Im trying to position my spritesheet somewhere in the middle of my screen, but when i scale my browser the spritesheet slips to a different position…
ctx.drawImage(playerImage, frameX, frameY, ...
0
votes
1
answer
54
views
Unity Sprite Colors Wrong, But Compression Is None, And Filter Mode Is Point
Problem
I know that Unity sprites have compression and filtering applied.
I have already disabled this on the images.
See below.
I have edited these in Gimp and when I export and import them into ...
1
vote
0
answers
16
views
How to use svg sprite in react?
Hello I search many questions in stackoverflow about this issue but nothing help me.
I have svg srite
<svg width="25" height="25" >
<symbol xmlns="http://www.w3.org/...
0
votes
0
answers
31
views
How to Use Sprites in InstancedMesh with Three.js and React Three Fiber in React?
I'm currently working on a NextJS proyect with React Three Fiber where I've created a Galaxy component that generates a starry background using instanced spheres. However, I'm trying to replace these ...
0
votes
0
answers
36
views
How to get text object to receive shadows?
I'm making a football-based game and I’m having an issue trying to get the number on the player kits to receive shadows. Everything else apart from the number receives shadows.
I've searched for ...
-1
votes
1
answer
47
views
Collision detection in pygame. Error: no attribute 'rect'
New to pygame, writing a little code to try and detect collisions. Here is a small test file I wrote up to demonstrate the error. It instantiates two sprites, and tries to detect collision between ...
0
votes
1
answer
84
views
SVG sprite and viewbox property
I am trying to create a SVG sprite and to understand how it works.
As I was looking for an example on the Internet, I found this one:
https://codepen.io/jnettik/pen/GRqmbvv
from this website: https://...
0
votes
1
answer
21
views
Unity SpriteRenderer changes but no visual change
I have an element that I am trying to change its appearance using a spriterenderer, and while my sprite changer script successfully changes the sprite renderer in the inspector, there's no visual ...
0
votes
0
answers
3
views
Scale up the dimensions of the internal image in the sprite and display 3rd image from the sprite
I am preparing my sprite by reducing the dimensions of the image. Successfully I prepare the sprite and load complete sprite on the web page using flex property.
Problem 1:
But when I want to scale up ...
-1
votes
1
answer
52
views
Unity Sprite Editor Slice Results in Diamond Shaped Slices/Missing Data
I am trying to slice a sprite sheet in Unity 2021.3.1. I have a 1024x1024 png I am saving 32x32 tile map sprites onto.
When I slice them they appear to be selected correctly.
But each sprite ends up ...
0
votes
1
answer
22
views
can not change the pivot of a sprite in unity
I want my character to have choice for haircut in my game so create many hair. But each has each shape (https://imgur.com/a/wcpFP4D) so I want to have a custom pivot for each sprite. I've already ...
1
vote
1
answer
46
views
How can I avoid some graphical glitches when updating a sprite?
I'm working on an assembly game engine project.
Is there a way in x86 assembly to clear the screen (CLS-like) fast?
I re-initialize the graphics mode to do this.
MOV AH,00H
MOV AL,13H
INT 10H
I get ...
0
votes
1
answer
41
views
Render SVG Symbol Sprite with linearGradient
I have this svg file
<svg preserveAspectRatio="xMidYMid meet"
focusable="false"
width="0"
height="0"
visibility="hidden"
...
0
votes
0
answers
60
views
My sprites don't fit in a single 4K Sprite Atlas. What happens with the remaining unpacked sprites that are added to a Sprite Atlas?
https://i.gyazo.com/3329293af0b92bf6ec443d8fb8b5d113.mp4
I tried to add a whole frame by frame animation clip to a Sprite Atlas but I don't want to ecceed 4K resolution. Do you think it automatically ...
0
votes
0
answers
125
views
How to correct my 2D Outline Shader Graph in unity?
I am a very beginner in making shaders in unity and only follow steps in tutorials in channels and that cause several problem in process because tutorials is for older versions of unity for example I ...
1
vote
1
answer
71
views
How to do a specific gap in PYGAME boundaries in top?
So basically I am trying to remove a gap from the top boundaries (see photo below), but how do I do it? I want to leave this very specific gap.
This is my code for boundaries:
SCREEN_WIDTH = 800
...
0
votes
0
answers
54
views
MapboxGL JS / Maplibre GL - Use image from sprite in HTML <img> tag
For my web map I have a sprite including multiple icons. I built a legend based on HTML div-elements and I would like to include some of the icons from the sprite in a simple img-tag like this:
<...
0
votes
1
answer
41
views
How to clear the pixel of a spriterenderer ata given world position
I have a sprite renderer scaled to fill screen and i need to clear the pixel at a given world position.
I have tried converting world position to screenpoint but it is displaced,the farther the coord ...
0
votes
1
answer
60
views
Scratch sprite won't stop movement
I am making a Scratch Mit project where a sprite is supposed to come as a monster, I have controlled its custom movement using the repeat block although once it goes out of my desired animation, it ...
1
vote
1
answer
75
views
LOVE2d is giving me an error for a nil value, though it was working fine before I added images to my sprites
I'm working on a top-down zombie survival game, and I had everything for the prototype working, but the moment I add images, everything breaks and I get this error:
Error
main.lua:46: attempt to ...
0
votes
1
answer
39
views
Group collide in Alien invasion
I have created the game AlienInvasion on Python crash course but the bullets are not hitting the aliens in the topmost row. Rather than clear the topmost row and create a new fleet, the game creates a ...
1
vote
0
answers
36
views
How to change sprite size in SDL2 [duplicate]
I'm Remaking Galaga to learn SDL2/SDL. I managed to render a sprite and display and create the windo and game loop. Problem is, The sprite takes up the whole screen. Is there way to fix this? Here's ...
1
vote
1
answer
99
views
DirectX 11 DrawInstanced render order
I'm just experimenting with rendering 2D sprites with DirectX11 using instancing.
It seems that the primitive order matters when using "DrawInstanced".
On the first try I tested with a ...
2
votes
1
answer
114
views
Basic twirl shader 2D pulls other sprites in spritesheet
I've been trying to achieve a basic twirl shader effect and I'm pretty close to achieve it. I'm new to shaders and dont understand what's going on here.
I have a spritesheet with several characters, ...
-1
votes
1
answer
37
views
How do i deepcopy a list containing Class objects which reference images in Pygame?
I'm trying to re-write a chess game with some improvements and am having problems since i added sprites.
In the original game i drew black or white circles with initials to represent the pieces. These ...
0
votes
1
answer
164
views
How to make a sprite move in individual directions in Flutter/Flame?
I want a character to follow a set of changeable directions in Flutter and Flame Game. This character is a sprite component that should move by block spaces (so moves one block forward, then one ...
0
votes
1
answer
91
views
Drag your finger to draw lines that to create a path and lead the dogs to their lovers in unity 2D?
I want to acheive the result shown in picture
Path Creation Like This. I have used line renderer in my other game where you save the dogs by drawing the line. In this game dogs have rigidbody and ...
1
vote
1
answer
101
views
p5.play dynamic objects moving towards each other and stopping without bouncing away from each other
Im trying to program a Age of War like game. This game is programmed in p5.js with the p5.play library. Im having trouble having sprites moving towards each other and stopping and then activating a ...
0
votes
0
answers
93
views
Website renders differently on Safari than Chrome
I am working to add on to an open source project that makes a pac man game in html, css, and js. The website renders properly on Chrome but does not work on Safari. Both work properly on screens with ...
0
votes
1
answer
96
views
Moving a sprite on a 2d plane along a circular path in C++
I am making a simple 2d arcade shooter game and am attempting to have the enemy sprites move in circular patterns.
The enemy's position on the screen is controlled by the two variables: ...
1
vote
1
answer
34
views
How to get the right position while resizing a sprite group in pygame?
My sprites are 16x16 pixels. I want to scale them, so they're appearing bigger in the game, but when I try to do this, the positions of the sprites are totally messed up.
I've sawn many examples for ...
5
votes
0
answers
377
views
AI generation of animated 2D sprites
I am developing a 2D top-down view game (more specifically, a Factorio mod rather than a stand-alone game). I need several models of buildings with simple animations indicating that they “do stuff” (...
0
votes
1
answer
83
views
How to make sprite show a picture without distorting colors?
CodeSpace Here
I am learning about THREE.js and struggling to add an image in scene without the colors looking washed out.
I tried changing the encoding too, but the colors are still off:
texture....
0
votes
1
answer
24
views
how to display only a few sprites from a group at a time
i wanted to make a game start screen and wanted to show only a few buttons at a time from a group, but i did not want to create multiple groups for each screen as i think its not optimal.
i have ...
0
votes
0
answers
47
views
Creating an algorithm to convert a pixel sprite into a rectilinear polygon
I am attempting to write an algorithm that would convert any pixel sprite to a set of vertices that compose a rectilinear polygon. My algorithm worked fine for sprites that have been scaled up. When I ...
0
votes
0
answers
21
views
Autodesk Web Viewer API - can't detect click event on Sprite. It always returns dbId: 0 which is the canvas)
I am building a web application to display sensor datas with a BIM model (in .rvt format). I am new to Autodesk API and I am having some problems on interactions with Sprite layer.
Since it requires ...
0
votes
0
answers
84
views
Svg disappears in chrome but works fine in firefox
Context:
I am trying to use @nuxtjs/svg-sprite in one of the nuxt application.
Expected behaviour:
Show the icon in all of the browsers except IE
Current behaviour:
The icon is visible only in the ...
0
votes
0
answers
20
views
c++ rotate sprite toward target destination using conditional logic
I'm making an autopilot for a sprite to direct it to a given location. The logic compares the sprite rotation to angle of a line connecting the target to the sprite. If the rotation is greater than ...
0
votes
0
answers
178
views
Changing sprite texture isnt working in godot (C#)
I'm making a simple Whack-a-Mole game, and I'm making a simple texture change for whenever you hit moles. But it doesn't seem to work properly, there are no errors, but the texture isn't changing.
The ...
0
votes
0
answers
20
views
LibGDX: Player objects are drawn on screen, not map, and do not move in sync with Box2D body. Any advice on how to fix?
This is how we set the Box2D body:
public void definePlayer() {
BodyDef bdef = new BodyDef();
bdef.position.set(32 / PPM, 32 / PPM);
bdef.type = BodyDef.BodyType.DynamicBody;
...