[Toolbox Jam] Pixel Canvas
I've recently been diving into Unity editor scripting to build tools for Squeeze Me. I'm having a lot of fun developing them. I've decided to do the toolbox jam as more of an exercise to learn more about Unity editor scripting. If there any tips and tricks you know of please let me know. I've found that the documentation isn't the best and tutorials are really hard to find apart from the basics.
I've decided to make a pixel editor in Unity.
If they're features you think I should think about adding please let me know.
BASIC FEATURES
Drawing & Editing
- Color Picker
- Brush Size (Square)
- Eraser
- Undo - Redo
File Operations
- New Canvas
- Choose Size
- Open Existing Sprite
- Save Sprite
Navigation
- Zooming in /out with shortcuts
- Panning with shortcuts
UI/UX Design
- Icons
- When closing Unity make sure user has saved (prompt to save)
- Tool Tips
- Border around drawing canvas
- Shortcut to change brush size
STRETCH GOALS
Drawing & Editing
- Primary Secondary colors
- Rectangular Marquee
- Shift pixels
- Create Palette
- Fill tool
- Different style brushes
File Operations
- Save Pixel Canvas project
- Open Pixel Canvas project
Layers
- Re-order layers
- Merge layers
- Add layer
- Remove layer
SUPER STRETCH GOALS
Animation System
I've decided to make a pixel editor in Unity.
If they're features you think I should think about adding please let me know.
BASIC FEATURES
Drawing & Editing
- Color Picker
- Brush Size (Square)
- Eraser
- Undo - Redo
File Operations
- New Canvas
- Choose Size
- Open Existing Sprite
- Save Sprite
Navigation
- Zooming in /out with shortcuts
- Panning with shortcuts
UI/UX Design
- Icons
- When closing Unity make sure user has saved (prompt to save)
- Tool Tips
- Border around drawing canvas
- Shortcut to change brush size
STRETCH GOALS
Drawing & Editing
- Primary Secondary colors
- Rectangular Marquee
- Shift pixels
- Create Palette
- Fill tool
- Different style brushes
File Operations
- Save Pixel Canvas project
- Open Pixel Canvas project
Layers
- Re-order layers
- Merge layers
- Add layer
- Remove layer
SUPER STRETCH GOALS
Animation System
Comments
I'd also like animation frames, and an easy way to add frames and preview animations (this could definitely be better than Photoshop's features in this field, though other pixel drawing programs handle animation better than Photoshop)
Does no tool like this exist for Unity already? It seems like a super useful plugin (if done well enough to replace Photoshop).
(This tool looks like it does some of this, though I don't know how well)
Plus I’m not sure how’d want animation to work. Especially on a workflow / pipeline level. I hated my experience in Pyxel Edit, Gimp was terrible too and both have different way they do animation.
Gimp uses layers thus you can’t use different layers per frame. Pixel Edit doesn’t make it easy to add frames in between other frames because of their sprite sheet system. I’ve never used Photoshop, Aseprite, or GraphicsGale. If I get this far I should really look into how they do animations. Basically do some research with some artists at this point.
Hadn't even seen RagePixel, it's free too. So, I'll be looking through how they accomplished stuff. Thanks for that. I did find Pixel Draw.
I thought I was going to build a whole undo stack system but there's a whole Undo class in Unity.
Learn't about blending colors
Panning and zooming took me longer than I thought
Here some gifs
The gif kinda shows how the UI looks now. Was really interesting the iterations I went through because I totally forgot that Unity come in 2 different skins and at first my icon toggle buttons looked great in pro version but not personal. I also didn't want to make my own GUISkin and found a work around using the standard GUISkin.
Oh, while I was fixing a bug to fix an issue I had with not being able to make smooth drawing because I would only paint every frame and that means if the mouse had been moved too quickly they'd be gaps. Fixing that helped me developed a tool that was in my stretch goals, the line tool. As shown below.
Hoping to have this done by end of the coming week and "release" a bare bone pixel editor. :)
@Sugborie you should check it out when you get to your animation features.
Here's one thing that popped up this weekend that I found worked differently between the three.
When you click down and start painting, if you go over the same pixel again without releasing the the mouse button what should happen? (assuming this is a color with some transparency)
A) You blend in the pixel again ( every time you go over the pixel it should get darker and darker)
B) Nothing happens. Only once you click again do you blend in the color. (So, keep clicking to get darker and darker)
Gimp and Aesprite chose B
Pyxel Edit chose A
I went with what the majority chose, although I feel like A makes more sense.
What does Photoshop do?
What would you like?
Opacity is the maximum amount of change you can make to a pixel per stroke. Flow is how much is changed per time-you-go-over-a-pixel. So you could use them simultaneously if you wanted to, to make a brush that gradually builds up as you repaint the same spot in the same stroke, but only up to a certain opacity.
I usually use single strokes to paint, so I'm unlikely to paint over a spot in the same stroke, making the difference negligible in my case.
[edit] I see some of these in your stretch goals, but just listing some stuff I'm likely to use regularly:
- Selection tools. Being able to drag a rect marquee, shift drag multiple rects in the same selection, and move/rotate my selection. I find that the vast majority of pixel art animation starts off this way. Even though the rotation often looks crap, it's a base on which I can fix things rather than drawing everything over again from scratch.
- Selection based on colour, and then either being able to HSV shift them or fill them with another colour for quick colour changes.
- If there's animation, then onion skinning.
I'm done! It's released! And you guys can see all my code on github too. Learnt a lot doing this. Planning on doing some post mortem thing. Will I get to those stretch goals? Maybe, one day. Swamped with so much other work. Just had to get it out the door. Hope there are no bugs.