FREELessons: 19Length: 2.4 hours

Next lesson playing in 5 seconds

  • Overview
  • Transcript

2.5 Vectors and Shapes in Sketch

A design will often start with a simple shape: a rectangle, a circle, or even a hand-drawn shape. In Sketch, you can use these simple shapes plus some complex ones, and you can also draw your own using the vector tool.

2.5 Vectors and Shapes in Sketch

Any design starts with a simple shape, either a rectangle, a circle or a hand drawn shape. Well in Sketch, you can start with those basic shapes but you can also use more complex ones. And you can also draw your own using the vector tool. So let's check these out. To create a shape, you would you go to Insert Shape. And you have a selection of shapes you can choose from, a rectangle, oval, a rounded rectangle, line, arrow, triangle, star, and polygon. So creating one of these is really simple. Simply choose the one you like, for example, a rectangle. Click and drag to your desired size. And that will automatically create a rectangle of that size, and it has this default fill color and default border color. At any point you can delete either the fill or the border or you can add new ones. So for example, I can add another border on top of my existing one and I can specify its position either center, inside, outside. It really depends on what I wanna do. And this is actually a really fast way of creating multiple borders in Sketch. Notice if I zoom in really close, I can now see my first border, which is positioned on the inside, and I can see my outer border or my second border, which is positioned on the outside. You can change the border with using this box. Border color changes from here. And you also have some additional more advanced border options in the section below like the ends and the joints. You can also create dotted borders by using the dash and cap options right here. If at some point you decide, I wanna hide or delete a border, you cam simply uncheck and then click this little button which will delete all unchecked properties. Same thing goes for fill. Only this time, on the fill side, we have some different options. For color, we can add solid color, a gradient, a radial gradient, an angular gradient or a pattern fill. And here we can add an image or a pattern, either one that's predefined, or we can add our own right here. Let's just stick with a solid color for now. So that's how you can create a simple shape. As I mentioned, there are a couple of shapes you can choose from. This was a rectangle but you can choose an oval tool, and this will create an ellipse, or if you hold down shift while dragging it will make sure the width and height are the same, so you draw a perfect circle. Then you have a rounded rectangle, which is basically the same as this rectangle, only by default it comes with a one radius right here. And you can change the radius either by sliding this control, or by entering the value manually in this box. You can also add lines using the line tool. So, the line is basically just an element starting from point A to point B. Holding down shift will actually constrain that line to either 0 degrees, or 45 or 90 or just increments of that 45 degree value. So it's really easy to draw a perfectly straight horizontal line or a perfectly straight vertical line or one that adds 45 degrees. You can also insert some more complex shapes like arrows, triangles, starss and polygons. With the arrow tool, it's simply click and drag just like you would with a line, only this is a more special line because you have a start and an end defined here and you can choose from a variety of start and end points. So it's really easy to create these more specialized lines. And of course it's the same like with any other line. You can define its color by changing the border value property. And if you add a fill to it, well it doesn't do anything because it's a simple line. So fills don't really make sense here. Other types, you have a star which you can draw like this, just like any other shape, and what's special about this is that you can define how many points you want to have in you star by using the slider or this text box here. And you can also define the radius, right? So how sharp, That star should be, or how, I guess, blunt it should be. I'm not sure if that's the correct term. And you can even turn this into a polygon if you have a minimum of three points. And going with the radius all the way to 100%. And speaking of polygons, you can also insert a polygon here. And, again, you can define how many sides you want it to have. Four sides it's a rhombus, five sides it's a penatgon, hexagon, heptagon, octagon, and so on and so forth. And this goes as many times as you want. Notice that our slider actually stops at ten, but we can enter higher numbers if we want to. So those are all the default shapes that come with Sketch. Now if you want you can define your own shapes by hand drawing them with the vector tool. So the vector tool goes something like this. Now let me actually get rid of all of these. So using the vector tool, or V, you build a shape by defining a series of points. So if I do point A, point B, point C and then I go back to point A, I've just created a triangle, and this is now a path. Now with the path, we can of course have control over the borders. And we can also add fill colors. And the area that's delineated by these lines will receive that fill color as you can see here. Now, the vector tool allows you to draw shapes that are not necessarily the same ones as we saw earlier. So instead of creating rectangles with this, we can do some more interesting things. For example, we can do this and then we can do this. So on the second point, we click and drag and we now have an arch, and then I can go here and I can make that arch longer. I can go here, And I can close that. And now I have this path, That I can use, and of course add borders, fills, and so on. And this is a custom path, it's hand drawn using the vector tool. At any point, I can go into, My path and edit each point individually. All I've gotta do is simply double click, and it takes me into edit mode. And here I can take each point, I can click on it, I can move it around. I can take each of these handles, I can move it around. I can make it shorter, I can make it longer. So it's really easy to refine a shape with these controls. And you can move this points either with your mouse or with your keyboard. Here I'm just nudging one pixel at a time using my arrow keys, or I can hold down Shift while pressing the arrow keys and it will nudge ten pixels at a time. Right here in the inspector, once we select one of these points, we have some options for the point type. So this right here is actually straight, so we will notice that those two handles for the angle are now gone and instead I just have a straight point. Or I can go back, I can click this one which is disconnected, I can modify these individually, not in tandem with one another, or I can click this one, which is asymmetric. Notice it has a slightly different functionality than the one before. I can click on a point, let's say this one, which is a straight point, and I can modify its radius, right? See how that behaves? And once I'm all done, I can hit finish editing. And now my shape is complete. Now one last thing before we wrap this up. I mentioned in the beginning of this course that Sketch is a vector based app. So what does that mean compared to let's say Photoshop, which is a raster based app? Well, vector based means that what you draw in here is basically a vector. So any shape you draw, any vector you draw, will retain its properties at any level of zoom. So, for example, right now, if I were to zoom in right here, you can see everything is really, really crisp. The lines, nothing is blurry, everything looks great, Even the curves that I drew here, right? It's all super, super smooth. Even the text, let's add a little bit of text here. Notice if I zoom in really close, everything is super sharp. Well, that's what a vector based app does. Photoshop, on the other hand, if you do this on a piece of text or on a shape, it's gonna get blurry at some point, because Photoshop is a raster based app it was made for editing photos not for creating user interfaces. All right, and that's a quick intro to using shapes and vectors in Sketch. Now, because digital design is way more than just using shapes, and it's also about using images and text, let's learn how to work with these two elements in Sketch. And we'll do that in the next lesson, so see you there.

Back to the top