[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.24,0:00:02.72,Default,,0000,0000,0000,,So we've been doing\Na lot of drawing so far. Dialogue: 0,0:00:02.72,0:00:05.19,Default,,0000,0000,0000,,But we haven't talked about\Nsomething as simple as say, Dialogue: 0,0:00:05.19,0:00:07.60,Default,,0000,0000,0000,,writing your name;\Nthat's what this lesson is about, text. Dialogue: 0,0:00:07.60,0:00:10.05,Default,,0000,0000,0000,,So why might you want to use text? Dialogue: 0,0:00:10.05,0:00:12.30,Default,,0000,0000,0000,,Well maybe we want to show \Nthe score in a game Dialogue: 0,0:00:12.30,0:00:14.74,Default,,0000,0000,0000,,or have characters talk, \Nor just to make our name grow Dialogue: 0,0:00:14.74,0:00:16.30,Default,,0000,0000,0000,,and shrink and change colors. Dialogue: 0,0:00:16.30,0:00:18.65,Default,,0000,0000,0000,,So let's go ahead and try and say "hello."\N Dialogue: 0,0:00:18.65,0:00:24.35,Default,,0000,0000,0000,,Say "text(hello)" and we have\Nthis weird error message that pops up, Dialogue: 0,0:00:24.35,0:00:27.42,Default,,0000,0000,0000,,saying that "hello is not defined,"\Nwhat does that mean? Dialogue: 0,0:00:27.42,0:00:29.43,Default,,0000,0000,0000,,Well, the problem is that the program Dialogue: 0,0:00:29.43,0:00:31.06,Default,,0000,0000,0000,,thinks that "hello" is a variable, Dialogue: 0,0:00:31.06,0:00:33.72,Default,,0000,0000,0000,,and it kind of makes sense \Nfrom the program's perspective Dialogue: 0,0:00:33.72,0:00:36.22,Default,,0000,0000,0000,,because maybe "hello" could be a variable, \Nhow would it know? Dialogue: 0,0:00:36.22,0:00:38.99,Default,,0000,0000,0000,,So how do we tell our program\Nthat it's actually text? Dialogue: 0,0:00:38.99,0:00:41.35,Default,,0000,0000,0000,,So that's easy, we just have to remember Dialogue: 0,0:00:41.35,0:00:43.16,Default,,0000,0000,0000,,to put these quotations marks around it. Dialogue: 0,0:00:43.16,0:00:45.08,Default,,0000,0000,0000,,And that says \Nthat no, this is not a variable, Dialogue: 0,0:00:45.08,0:00:46.46,Default,,0000,0000,0000,,and in fact this is text Dialogue: 0,0:00:46.46,0:00:48.15,Default,,0000,0000,0000,,or we want you to display it as text, Dialogue: 0,0:00:48.15,0:00:50.23,Default,,0000,0000,0000,,and you can remember this\Nby thinking of a book, Dialogue: 0,0:00:50.23,0:00:51.74,Default,,0000,0000,0000,,where all the characters talk, Dialogue: 0,0:00:51.74,0:00:53.69,Default,,0000,0000,0000,,and there are quotes\Naround what they are saying. Dialogue: 0,0:00:53.69,0:00:56.16,Default,,0000,0000,0000,,And similarly, when you want \Nthe program to say something, Dialogue: 0,0:00:56.16,0:00:58.40,Default,,0000,0000,0000,,that text has to have \Nthese qutoes around it. Dialogue: 0,0:00:58.40,0:01:00.90,Default,,0000,0000,0000,,And this is actually really important\Nand easy to mess up. Dialogue: 0,0:01:00.90,0:01:03.89,Default,,0000,0000,0000,,So i'm just going to say it again,\Nanytime you want to use text Dialogue: 0,0:01:03.89,0:01:05.75,Default,,0000,0000,0000,,in your program you always have to use Dialogue: 0,0:01:05.75,0:01:07.53,Default,,0000,0000,0000,,these quotation marks around it. Dialogue: 0,0:01:07.53,0:01:10.11,Default,,0000,0000,0000,,Otherwise you're going to get\Nsome really weird error messages. Dialogue: 0,0:01:10.11,0:01:12.61,Default,,0000,0000,0000,,And remember, if you do see\Nthose weird error messages, Dialogue: 0,0:01:12.61,0:01:15.36,Default,,0000,0000,0000,,just be sure to double check\Nthat you are remembering to use quotes. Dialogue: 0,0:01:15.36,0:01:17.23,Default,,0000,0000,0000,,Great! so now we're using quotation marks, Dialogue: 0,0:01:17.23,0:01:18.76,Default,,0000,0000,0000,,and we don't get an error anymore. Dialogue: 0,0:01:18.76,0:01:20.93,Default,,0000,0000,0000,,But you might have noticed\Nthat nothing is happening, Dialogue: 0,0:01:20.93,0:01:22.22,Default,,0000,0000,0000,,and it's still blank, Dialogue: 0,0:01:22.22,0:01:24.89,Default,,0000,0000,0000,,but what is kind of strange is\Nif we set a "background," Dialogue: 0,0:01:24.89,0:01:29.11,Default,,0000,0000,0000,,something, say just a red, \Nthen we see that it is actually there. Dialogue: 0,0:01:29.11,0:01:33.12,Default,,0000,0000,0000,,It's just in white, so the problem is \Nif we think about it, Dialogue: 0,0:01:33.12,0:01:36.11,Default,,0000,0000,0000,,that we were writing white text, \Nonto a white background, Dialogue: 0,0:01:36.11,0:01:37.95,Default,,0000,0000,0000,,and that's why we couldn't see it. Dialogue: 0,0:01:37.95,0:01:40.45,Default,,0000,0000,0000,,So that seems a little bit silly, \Nwhy were you writing Dialogue: 0,0:01:40.45,0:01:42.94,Default,,0000,0000,0000,,white text onto white background? Dialogue: 0,0:01:42.94,0:01:45.89,Default,,0000,0000,0000,,Well, we could just change it, \Nbecause we learned how to set Dialogue: 0,0:01:45.89,0:01:47.01,Default,,0000,0000,0000,,the fill of something. Dialogue: 0,0:01:47.01,0:01:49.89,Default,,0000,0000,0000,,And just like we can set the fill \Nof a rectangle or a line, Dialogue: 0,0:01:49.89,0:01:51.80,Default,,0000,0000,0000,,we can set the fill of text to anything Dialogue: 0,0:01:51.80,0:01:54.23,Default,,0000,0000,0000,,just like before, and then there it is! Dialogue: 0,0:01:54.23,0:01:56.41,Default,,0000,0000,0000,,It shows up without \Nneeding the background, Dialogue: 0,0:01:56.41,0:02:00.61,Default,,0000,0000,0000,,so let's look a little bit more\Nto how this text thing is working. Dialogue: 0,0:02:00.61,0:02:02.32,Default,,0000,0000,0000,,The first part, is obvious enough, Dialogue: 0,0:02:02.32,0:02:04.42,Default,,0000,0000,0000,,it's just whatever text we want to write. Dialogue: 0,0:02:04.42,0:02:06.58,Default,,0000,0000,0000,,The next part, if we change it, Dialogue: 0,0:02:06.58,0:02:08.95,Default,,0000,0000,0000,,we can see that it's basically\Njust how far over, Dialogue: 0,0:02:08.95,0:02:11.78,Default,,0000,0000,0000,,and the next one\Nis just how far up and down. Dialogue: 0,0:02:11.78,0:02:14.82,Default,,0000,0000,0000,,That probably looks really familiar\Nfrom when we were just Dialogue: 0,0:02:14.82,0:02:15.87,Default,,0000,0000,0000,,drawing rectangles. Dialogue: 0,0:02:15.87,0:02:17.62,Default,,0000,0000,0000,,One thing that's a little bit tricky Dialogue: 0,0:02:17.62,0:02:19.54,Default,,0000,0000,0000,,is that text has these two coordinates Dialogue: 0,0:02:19.54,0:02:24.26,Default,,0000,0000,0000,,specify the lower left part, \Nso this corner of the text. Dialogue: 0,0:02:24.26,0:02:27.22,Default,,0000,0000,0000,,While with rectangles\Nit's the upper left, this corner. Dialogue: 0,0:02:27.22,0:02:30.28,Default,,0000,0000,0000,,And that can seem like it was\Njust designed to confuse you, Dialogue: 0,0:02:30.28,0:02:32.76,Default,,0000,0000,0000,,but it's just something\Nyou kind of have to remember. Dialogue: 0,0:02:32.76,0:02:34.91,Default,,0000,0000,0000,,And we can even experiment \Nand see it for ourselves, Dialogue: 0,0:02:34.96,0:02:39.22,Default,,0000,0000,0000,,by we can set this to say, "height,"\Nand we can see that, Dialogue: 0,0:02:39.22,0:02:42.45,Default,,0000,0000,0000,,yeah, it is setting the height\Nto be this lower left coordinate. Dialogue: 0,0:02:44.36,0:02:46.22,Default,,0000,0000,0000,,Or we can set it to zero, Dialogue: 0,0:02:46.22,0:02:50.00,Default,,0000,0000,0000,,and you think what should we expect then? Dialogue: 0,0:02:50.00,0:02:53.39,Default,,0000,0000,0000,,And we don't see it at all, \Nbut if we slowly start increasing this, Dialogue: 0,0:02:53.39,0:02:56.33,Default,,0000,0000,0000,,we can see that, yeah it is kind of\Njust like peeking out there. Dialogue: 0,0:02:56.33,0:02:59.78,Default,,0000,0000,0000,,Because again, that lower left coordinate\Nis what we're specifying, Dialogue: 0,0:02:59.78,0:03:01.75,Default,,0000,0000,0000,,not the upper left. Dialogue: 0,0:03:01.75,0:03:05.61,Default,,0000,0000,0000,,Okay, so enough of analyzing\Nthis text thing, Dialogue: 0,0:03:05.61,0:03:07.28,Default,,0000,0000,0000,,let's go ahead and make it better. Dialogue: 0,0:03:07.28,0:03:09.51,Default,,0000,0000,0000,,For example, \Nlet's start to make it bigger, Dialogue: 0,0:03:09.51,0:03:12.44,Default,,0000,0000,0000,,we can do that with "textSize" \Nwhich just tells the program Dialogue: 0,0:03:12.44,0:03:13.89,Default,,0000,0000,0000,,how big to draw the text. Dialogue: 0,0:03:13.89,0:03:16.10,Default,,0000,0000,0000,,And we can make it "30,"\Nwhich is pretty big, Dialogue: 0,0:03:16.10,0:03:17.69,Default,,0000,0000,0000,,we can make it even bigger, Dialogue: 0,0:03:17.69,0:03:20.46,Default,,0000,0000,0000,,or we can make it really, \Nreally, really, really small. Dialogue: 0,0:03:20.46,0:03:23.03,Default,,0000,0000,0000,,Whatever we want, so let's go ahead\Nand draw your name Dialogue: 0,0:03:23.03,0:03:25.64,Default,,0000,0000,0000,,and maybe a little message\Nabout yourself underneath. Dialogue: 0,0:03:25.64,0:03:28.65,Default,,0000,0000,0000,,Since I don't know your name,\NI'm just going to draw my name. Dialogue: 0,0:03:28.65,0:03:30.87,Default,,0000,0000,0000,,You can switch it to yours in a moment. Dialogue: 0,0:03:30.87,0:03:34.26,Default,,0000,0000,0000,,So using what we just learned, \Nwe can say "text("Sophia")" Dialogue: 0,0:03:34.26,0:03:35.89,Default,,0000,0000,0000,,and there my name is. Dialogue: 0,0:03:35.89,0:03:38.14,Default,,0000,0000,0000,,And then maybe want to put \Na little message underneath, Dialogue: 0,0:03:38.14,0:03:43.49,Default,,0000,0000,0000,,like, "I like puppies\Nand guitars and coding." Dialogue: 0,0:03:43.49,0:03:46.71,Default,,0000,0000,0000,,So that's great, \Nexcept that we obviously need Dialogue: 0,0:03:46.71,0:03:48.94,Default,,0000,0000,0000,,to change the positions \Nso they don't overlap. Dialogue: 0,0:03:48.94,0:03:51.65,Default,,0000,0000,0000,,And oh no, no, \Nthat's kind of a long string of text, Dialogue: 0,0:03:51.65,0:03:55.45,Default,,0000,0000,0000,,so let's change it\Nto be a smaller text size. Dialogue: 0,0:03:56.50,0:03:58.63,Default,,0000,0000,0000,,And there we go, that's pretty good. Dialogue: 0,0:03:58.63,0:04:00.96,Default,,0000,0000,0000,,Except, I don't know,\Nit's kind of boring having Dialogue: 0,0:04:00.96,0:04:04.39,Default,,0000,0000,0000,,them both be blue,\Nso let's just change the "fill," Dialogue: 0,0:04:04.39,0:04:06.93,Default,,0000,0000,0000,,and let's make it maybe a nice, \Nhmm I don't know, Dialogue: 0,0:04:06.93,0:04:09.80,Default,,0000,0000,0000,,maybe a nice, like, purple. Dialogue: 0,0:04:09.80,0:04:13.13,Default,,0000,0000,0000,,Alright, and there you go, \Nthat's all there is Dialogue: 0,0:04:13.13,0:04:16.10,Default,,0000,0000,0000,,to drawing text and changing \Ncolors and changing size.