Ask coding questions

← Back to all posts
How to plot out a point on a sprite sheet
Dunce (45)

How would I plot out point on a sprite sheet? this might not be the best place to ask this, but I wasn't sure were else to.

Answered by SixBeeps (5063) [earned 5 cycles]
View Answer
Comments
hotnewtop
SixBeeps (5063)

Looks like some peeps have already made some code to handle spritesheets in Pygame: https://www.pygame.org/wiki/Spritesheet

Though in general, you'd feed some image loader the spritesheet along with either how many frames there are or the size of one frame. Then, you'd split the spritesheet into smaller subimages based on that size that you gave it, and return it as an array of images.

Coder100 (16968)

that's way too generic
plot it on excel? matplotlib? paper? where?

Dunce (45)

@Coder100 Idk, I use pixilart.com to create my sprites, I would like to know how to plot it on something, that's free.

Coder100 (16968)

wat
that's not specific enough, you want to export it to like rpilt? @Dunce

Dunce (45)

@Coder100 I want to get the coordinates of any given pixel in an image, than I want to upload the image to replit, and use those coordinates to get an image I can use in my pygame game.

Coder100 (16968)

seems like a complicated way of drawing an image
why not just draw it @Dunce

Dunce (45)

@Coder100 Sprite sheets are more memory efficient, and it's nice to be able to draw all the frames of an animation in one image. But SixBeeps answered my question, and sorry I wasn't specific enough :)