1
00:00:01,730 --> 00:00:07,590
I mean, the last video we started to draw and this video I want to sort of add on to our create line

2
00:00:07,590 --> 00:00:11,340
function that had different parameters to change the style of this thing.

3
00:00:11,350 --> 00:00:15,020
So we want to make the the brush size bigger.

4
00:00:15,030 --> 00:00:20,910
We want to make it a different type of brush round versus diamond versus slash versus whatever.

5
00:00:21,090 --> 00:00:23,400
We want to be able to change the color at will.

6
00:00:23,850 --> 00:00:25,650
So let's let's do that in this video.

7
00:00:25,650 --> 00:00:27,420
So I'm going to start.

8
00:00:28,530 --> 00:00:33,720
By saying rush parameters.

9
00:00:36,110 --> 00:00:37,400
I spoke parameters, right?

10
00:00:37,670 --> 00:00:38,720
So what do we want?

11
00:00:38,750 --> 00:00:41,200
We want the width to equal something.

12
00:00:41,450 --> 00:00:46,790
We want the brush, let's say, underscore color to equal something.

13
00:00:47,150 --> 00:00:48,380
And what else do we want?

14
00:00:48,590 --> 00:00:52,220
Let's say brush, underscore type equal something.

15
00:00:52,520 --> 00:00:55,220
And for width, let's call this let's keep it consistent.

16
00:00:55,220 --> 00:00:56,840
Let's call it brush with, I guess.

17
00:00:57,110 --> 00:01:01,520
And now we need to change our function down here up a little bit.

18
00:01:01,550 --> 00:01:04,000
So right now we just have Phil Red.

19
00:01:04,010 --> 00:01:11,720
So instead of setting this color as red, let's change this to this brush color variable so we can just

20
00:01:11,720 --> 00:01:14,150
substitute that in for that.

21
00:01:15,120 --> 00:01:20,760
Now, we also want the width so we can call, we can call with.

22
00:01:22,230 --> 00:01:23,670
And set that equal.

23
00:01:24,860 --> 00:01:26,960
Do something, what's the width?

24
00:01:26,990 --> 00:01:29,090
Well, it's going to be our brush with right here.

25
00:01:30,260 --> 00:01:32,260
Oh, we can pass that in there.

26
00:01:33,590 --> 00:01:38,090
And then finally, what kind of brush we do this by something called cap style.

27
00:01:39,970 --> 00:01:46,140
And set that equal to something and the cap style will be the brush type right here.

28
00:01:46,930 --> 00:01:52,120
So let's pass that in there and we'll look at this cap style in just a second.

29
00:01:52,150 --> 00:01:55,530
For now, let's let's create these.

30
00:01:55,530 --> 00:01:59,190
So let's say let's call this brush with 20.

31
00:01:59,410 --> 00:02:04,960
Now, obviously, later on we'll set up widgets that we can add this in our program so you can click

32
00:02:04,960 --> 00:02:11,440
a button on your program to make the drag and drop the brush size differently and to add colors and

33
00:02:11,440 --> 00:02:11,920
stuff like that.

34
00:02:11,920 --> 00:02:15,430
But for now, we're just going to kind of hard put this in and for the brush color.

35
00:02:15,460 --> 00:02:22,180
Let's just call this, I don't know, green for now and for the brush type, I'm going to say, but

36
00:02:22,360 --> 00:02:27,730
let's go ahead and save this and let's run this just to make sure it worked.

37
00:02:28,940 --> 00:02:31,550
And now I can see.

38
00:02:32,580 --> 00:02:34,140
It's bigger and.

39
00:02:35,210 --> 00:02:43,610
You can see it's sort of slashing now is right, and if I do it very quickly, it goes like this slower,

40
00:02:44,420 --> 00:02:45,620
it's nice and smooth.

41
00:02:46,100 --> 00:02:50,450
And this brush color or this brush type, I called it.

42
00:02:50,450 --> 00:02:53,480
But you see, it's like a slash here.

43
00:02:53,780 --> 00:02:59,330
And there are basically three different brush types, cap styles we can we can play with.

44
00:02:59,480 --> 00:03:01,490
And so let's go.

45
00:03:04,030 --> 00:03:04,570
Type.

46
00:03:07,410 --> 00:03:08,310
Round.

47
00:03:09,180 --> 00:03:10,800
And projecting.

48
00:03:11,960 --> 00:03:18,890
So that was but we can also try round and these need to be capitalized and not in quotation marks.

49
00:03:19,130 --> 00:03:21,760
So if we save this, let's run this guy again.

50
00:03:23,440 --> 00:03:29,540
You can see now it's around if we just do one see, it's a round circle, right?

51
00:03:32,820 --> 00:03:40,890
So that's round makes sense, and then finally, projecting is diamond shaped.

52
00:03:40,910 --> 00:03:41,790
So if we save this.

53
00:03:43,660 --> 00:03:44,730
Run this guy again.

54
00:03:46,570 --> 00:03:52,600
Now we have this right, so if I just do one, it's a it's kind of like a diamond, right?

55
00:03:54,530 --> 00:03:59,060
So those are the three cap styles that come with Kenta, and so those are the three that we're going

56
00:03:59,060 --> 00:03:59,490
to use.

57
00:03:59,960 --> 00:04:04,340
You can maybe invent other ones, I'm sure, but that's sort of beyond the scope of this course would

58
00:04:04,340 --> 00:04:05,360
be a lot more difficult.

59
00:04:05,450 --> 00:04:06,290
And we don't really care.

60
00:04:06,300 --> 00:04:10,460
We're just we're not creating a professional paint program in this course.

61
00:04:10,460 --> 00:04:14,480
We're just doing this, you know, sort of fun little thing to teach you some concepts.

62
00:04:14,690 --> 00:04:21,320
But it's a nice little set of brush types that you can do just by defining this brush type right here,

63
00:04:21,560 --> 00:04:24,010
which is the cap style down here.

64
00:04:24,020 --> 00:04:25,250
So just a quick recap.

65
00:04:25,490 --> 00:04:31,400
Change the size of the brush we just set up with parameter to change the color of a brush.

66
00:04:32,120 --> 00:04:35,990
We just set the fill to it any color we like.

67
00:04:36,380 --> 00:04:41,510
And to do the different types of brush styles, we just do cap style.

68
00:04:41,780 --> 00:04:47,930
And then the cap style can be either but round or projecting, but as round as round and projecting

69
00:04:47,930 --> 00:04:50,190
is diamond and that's all there is to it.

70
00:04:50,210 --> 00:04:51,620
So very simple.

71
00:04:51,860 --> 00:04:55,530
We're starting to build some functionality into this thing and just that easy.

72
00:04:55,640 --> 00:04:58,310
So we've hardcoded all of these things right here.

73
00:04:58,880 --> 00:05:02,060
We've said, hey, our brush with is going to be 20, right?

74
00:05:02,090 --> 00:05:03,140
It's going to be green.

75
00:05:03,140 --> 00:05:04,120
It's going to be this.

76
00:05:04,160 --> 00:05:08,060
What if we want to update those things from the program while it's running?

77
00:05:08,450 --> 00:05:10,190
So we're going to start to look at in the next video.
