- Home /
Making a dynamic item creator with a collection of pre-made 2D sprites
Hello everyone.
I should preface my question by saying that I am a novice programmer, so if I am asking something obvious here, please account for my ignorance.
The problem I am struggling to solve is with creating a character creator style system for creating items in game.
I am looking to create something like this:
It's a rough sketch, I know, but I hope it gets the idea across. This screen would allow the player to switch between sprites in each row. At the end of the process the system would spit out a merged image that would looks something like this:
My current idea of an architecture for this is to create 3 separate arrays (1 for each row) and then assign the last displayed sprites from each of the 3 arrays to a new sprite that would make up the new image/object.
Could someone please tell me whether I am thinking in a correct direction with this?
Thank you,
Answer by Cornelis-de-Jager · Jul 17, 2017 at 04:51 AM
It is actually very simple and well thought out. I do have some tips which help you in the long run, but either than that good idea.
I would say use a list instead of an Array. It allows for more manipulation via code.
It might be better performance wise to have an complete image for each combination loaded. (Should not matter though) Plus its easier to manipulate one image than three within the scene.
So my line of thought is somewhat correct then, good!
Is there a way to generate the sprites dynamically without having to premake all the possible combinations?
Your answer
![](https://koobas.hobune.stream/wayback/20220612130132im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to call sprite at run time 3 Answers
Export objects to a .3DS file at runtime 1 Answer
Multiple Materials on Multiple Objects -runtime- 1 Answer
Edit terrain heightmap and save during runtime? 1 Answer
Check What Material is Being Used? 1 Answer