Sprite - direct pixel manipulation
Posted: Tue May 02, 2023 6:43 pm
Hi all.
I'm trying to make a simple game.
I created an image that contains all the sequences of sprites that I would like to display in the game.
What I need is to modify a color knowing the codes of the palettes used in my image. I would like to do this after loading the image (loadsprite), i.e. before issuing the command (displaysprite) which must display the image with the already modified colors. The sprites are soccer players and must have the colors of the shirts chosen in the game menu, therefore I would like to avoid creating many images to upload for each shirt color.
I'm trying to find a way to modify the image directly in memory (after the loadsprite command) and NOT by displaying the sprites on the screen and then modifying the pixels.
Please, does anyone have any examples or suggestions to show me?
Thank you. Greetings.
I'm trying to make a simple game.
I created an image that contains all the sequences of sprites that I would like to display in the game.
What I need is to modify a color knowing the codes of the palettes used in my image. I would like to do this after loading the image (loadsprite), i.e. before issuing the command (displaysprite) which must display the image with the already modified colors. The sprites are soccer players and must have the colors of the shirts chosen in the game menu, therefore I would like to avoid creating many images to upload for each shirt color.
I'm trying to find a way to modify the image directly in memory (after the loadsprite command) and NOT by displaying the sprites on the screen and then modifying the pixels.
Please, does anyone have any examples or suggestions to show me?
Thank you. Greetings.