RagePixel
RagePixel copied to clipboard
Refactor RagePixelSpriteEditor's painting functionality for other components
This was discussed on the forum but I thought it would be appropriate to have an issue to track it on github. @JuhaKiili I know you're busy working at Unity now but perhaps you could let us know how far you got. Perhaps one of us could help you out with it.
There is one big thing that needs to be done and it might be that I'm the only one who can pull it off.
I'd assume there will be more similar components like Text-component and Tilemap etc. I think all these components are going to need similar painting functionality that the Sprite component now has.
Currently all the painting code + UI is in the sprite component. I used a text component in my Ludum Dare game, but I just copy-pasted everything from the sprite -> text. This is bad. I would need to refactor big time, so that most of this code is moved to somewhere where it is reusable. This is a big maneuver, but I hope I could find some time to pull off before work starts at Unity. -- Forum post
I made a few fixes to the editor in 6f5815401e that would need to be merged.
I never really got far. I kept moving it to "tomorrow" and progress was very lame. I guess the main thing is to make an interface IPaintable and have all the different components like sprite, text, tilemap, etc. implement it.
After that you can write painting/other GUI stuff against the IDrawable and reuse it for everything. Not an easy thing to do, though.