Hello all!
So I’m a bit new when it comes to programming anything that comes to images, and I’ve been handed an image file that’s basically a spreadsheet of faces that are used as our player health (think doom with cartoon faces). I can’t seem to figure out how to pull out of the image just one face at a time. Do I have to create 6 different files (for each face) within the code? Is there a way I can call the image with just a given set of pixels based on player health? Any guidance on where I could look would be appreciated.
You can show just part of an image by using a group. When you draw into a group, the coordinates of the element’s rectangle are relative to the group rectangle. You can use negative coordinates here to start drawing the texture outside the group (so part of it will be obscured). Since the displayed area of the texture will be the same size as the group rectangle and you can start drawing at any position, you can isolate any part of the image.