Published using Google Docs
ProtoSprite Documentation

Unity 2022.2+

Overview

ProtoSprite is an easy to use Unity Editor tool that allows you to rapidly create, draw and edit sprites directly in the Scene View in the context of your Scene. It’s intended for quickly creating prototypes or pixel art with minimal friction and tight Unity integration. It creates and uses PNG texture files, which are widely compatible with other software if needed.

Required Packages

  1. Mathematics - com.unity.mathematics
  2. Burst - com.unity.burst
  3. Collections - com.unity.collections
  4. 2D Sprite - com.unity.2d.sprite
  5. 2D Common - com.unity.2d.common

Quick Start

  1. Open the ProtoSprite window via Window > 2D > ProtoSprite
  2. In the ProtoSprite window click the “+” menu in the top left, select Default and enter a name and file location.
  1. This will create a new GameObject as well as a Texture file
  2. The GameObject will automatically have a SpriteRenderer with a sprite linked to the newly created texture
  1. With the GameObject selected click the Paint Tool (first tool on the left) in the ProtoSprite window
  2. Draw on the GameObject inside the Scene View
  1. Change the Color and Brush Size in the ProtoSprite window
  1. Save your changes with Ctrl/Cmd + S or clicking the Save button in the ProtoSprite window, or by going to File > Save Project.

ProtoSprite Window

Opened via Window > 2D > ProtoSprite.

This window allows you to create new textures and GameObjects and access all the tools for modifying the sprites. Drawing, resizing and adjusting sprite pivots can all be accomplished with lightning speed.

Tool shortcuts are only active when the ProtoSprite window is both open and visible. This helps reduce shortcut key conflicts considerably. Allowing you to have the ProtoSprite window and e.g. the Unity Tile Palette window docked in the same area and switch between the tabs to control shortcut key contexts.


Add/“+” Menu

New ProtoSprite compatible textures with associated GameObjects can be quickly created using the “+” menu. The Default option will create a texture using the values stored in the Default Settings panel. The Default Settings can also be accessed from the “+” menu.

The Default functionality can also be done via the GameObject > 2D Object > ProtoSprite menu option or by right clicking in the Hierarchy and selecting 2D Object > ProtoSprite.

You can create your own presets to add to the ProtoSprite “+” menu so you can quickly create ProtoSprites of desired dimensions etc by using the ProtoSpriteAddMenuItem attribute on a method inside your own Editor scripts (put the script in a folder called “Editor”) . E.g.

using UnityEngine;

using ProtoSprite.Editor;

public class MyProtoSpriteMenuItems

{

    [ProtoSpriteAddMenuItem("Pixel Art/16x16")]

    private static void Create16x16()

    {

        // Creates a GameObject with SpriteRenderer

        // and a texture with ppu = 16, pivot = (0.5,0.5) and dimensions = (16,16)

        GameObject gameObject = ProtoSpriteWindow.CreateProtoSprite(16.0f, new Vector2(0.5f, 0.5f), new Vector2Int(16, 16));

    }

}

Duplicate Button

Creates a duplicate sprite texture file and sets the currently selected SpriteRenderer to reference it. Useful for creating a new frame when animating or for quickly creating a variant by duplicating the GameObject with Ctrl/Cmd + D and then using the ProtoSprite duplicate button to duplicate the texture for the new GameObject.

Tools

Paint

Shortcut: B

Erase

Shortcut: D

Fill

Shortcut: G

Resize

Shortcut: N


Pivot

Shortcut: C

Saving

Remember to save regularly. Saving in this context refers to the texture data that’s loaded in memory being saved to the PNG file on disk. Certain operations such as Resize and Pivot will trigger a save automatically but painting operations must be saved manually (e.g. using Ctrl/Cmd + S). Certain Unity events (such as closing Unity) will also trigger a save of all modified textures. The ProtoSprite window will show a “*” in the title (“ProtoSprite*”) if there are unsaved changes.

Compatibility & Limitations

When a new ProtoSprite is created it is set up to automatically be compatible with the ProtoSprite tools. However, for any already existing textures/sprites they must adhere to the following in order to be editable by the ProtoSprite tools. If a selected object is not compatible with the ProtoSprite tools a message will display in the ProtoSprite window providing the reason for incompatibility.

  1. SpriteRenderer Draw Mode: Simple
  2. Texture File Type: PNG
  3. Texture Size <=2048 and imported size must match source size
  4. Texture Importer Read/Write: Enabled
  5. Texture Importer Format: RGBA32
  6. Sprite must not be packed in a Sprite Atlas unless Sprite Packer Mode is set to Enabled for Builds (so the sprite atlas texture isn’t used while in the Editor)
  7. Not intended to be used with SpriteSkin or Unity’s sprite vertex deformation/bone tools