Change Tools Button

Now we have a simple canvas. let's create some simple UI controls to change our tools.

Ink Button

As you can see we have Basic brush pack in the Assets/PaintCraft/BrushPack folder. And you can freely use them in your projects.

Let's create standard unity buttons which will change some tools

  1. Create one UI button GameObject/UI/Button I'll put it to the left bottom corner and name it Ink
  2. Add ChangeBrushOnClickController on to it
    change brush on click controller
  3. Now you need to set LineConfig refference to our prefab subcomponent on our scene PaintCraft/Canvas/LineConfig. Actually you can click right circle on the right side of this property and it will show you just one possible object, because we have only one right now
    line  config refference
  4. And final step is to set link to our tools. use the same circle and select Ink config from our basic pack. Don't forget to switch to Assets tab because this is a config stored in our project and not a scene object
    select ink

Now you can start your scene and try to draw with the brush (because it's already selected in our line config as default tool) and after you click Ink button you will draw with ink
brush and ink

Spray Button

If you want to add more tools just clone InkButton object and change refference to the tool 1. to clone object select Ink Button and then click Edit/Duplicate or just ctrl+D or cmd+D on mac 2. Change position of this object. I'll change PosY in the rect transform so it will be alligned with my Ink button
change y position 3. Select the Spray object as you did it in previous fourth step 4. And now rename your button and text value to your tool name Spray

And now let's change our default tool in our line config. Select PaintCraft/Canvas/LineConfig object. Click on Brush and select Ink

Now when you start your scene you will draw with Ink and you will be able to switch this tool to Spray and back.
ink and spray

Back Next: Canvas Controls Button