Welcome back.
So our spell menu is one step closer, but it's not quite done.
But what I'd like to implement at this point are my descriptions.
Now, when I click on a spell globe, I should see something pop up in my description box, and that's
going to depend on the status.
It's also going to depend on the abilities level because I want to show the description for that level
and I'd like to show the description for the next level.
So we have a few things to do.
But what I'd like to use for the description is a rich text.
Block.
Now if you haven't heard of a rich text block in Unreal, it's a way to have text that's formatted richly.
A normal tax block would just have to be all the same font and all the same color.
But a rich text block allows us to have a message where we can format a string to use different styles
based on characters that we have in that string.
I'll show you what I mean.
Let's go ahead and go to our spell menu.
And in our scroll boxes, these are scroll boxes.
We can add a rich text block.
So if I take text and get instead of text, which we've always been using, we're going to get a rich
text block and put that into the scroll box here.
Now we have this rich text block, which is actually a great deal more interesting than a regular text
block And we'll see why very shortly.
Now, the rich text block in this scroll box is going to be my description text.
So I'm going to call it rich Text Underscore description.
And I'm going to set it to is variable right away.
And I'm going to also put a rich text block in this other scroll box down here and call this one rich
text, underscore next level description like so.
Now, with rich text blocks, we have to specify a collection of styles that we're going to use styles
as in fonts with colors and so on.
So we have to create that styles collection, and that collection has to be in the form of a certain
data table.
So what I'm going to do is go into blueprints, UI data because we have a data folder here.
I'm going to make a new data table by going to miscellaneous choosing data table.
And we have to choose a very specific row structure.
It has to be rich text style row.
Notice there's a rich image row too, so we can do things that contain images as well.
But we're just going to do rich text style row and click okay.
And this is going to be d t underscore rich text style.
And if we double click and open this up, the rich text style row structure allows us to add a new row.
And we have to give this row a name.
For example, we'll give this one default.
And in the row editor down here, we can see we have a dropdown called Text style.
And it looks like the style for text in a widget.
So we can set the font for our default.
So I'm going to set this to Amaranth regular font.
I'll set the size to 16.
Of course we'll be able to tweak it if we have to.
I'm going to set the color to white.
And, you know, I like my outline, so I'm going to expand outline settings, set the outline size
to one.
That's just a habit I have.
I just really like the outlines.
And now that we have this default style, we can use it in our rich text block.
Here's how we do it.
First, I'm going to save this, and we go back to our rich text.
Block I'm going to go to Rich text description.
And notice we have a text style set and it's a data table we can set.
I'm going to choose rich text style.
I'm going to do it for both of these rich text blocks.
We're going to set the data table to our rich text style, which contains the style.
Called default.
Now to use default.
Here's how we do it here in text.
We set the text.
We use opening and closing pointy brackets.
I'm going to say default here and I'm going to say description text.
And to end the default formatting, we use pointy brackets with a forward slash.
Now, if I compile, I'll actually see it.
So before I compiled, I didn't actually see the text.
I saw a bunch of red purple ish shapes.
So if we compile then we can see it.
And so that's what our description text looks like.
And now we're seeing that we need some padding so I can select both of my rich text blocks and give
them a little bit of padding like, say 12.
But we can see that now.
Our string has that font.
Now it seems like that was a lot of trouble just to get a specific style and it may not seem worth it,
but believe me, it's really, really worth it because we can come back in here and add more styles.
I'm going to add a new one called Damage.
And let's just change this around a bit.
I'm going to use the same font family and the same font size and also the outline size of one.
But I'm going to go ahead and change that color to a more reddish color, maybe a reddish pinkish color
like this.
Now, here's the cool thing.
If I take that text string, I can now change it.
I'm going to say.
Inside of the default formatting, I'm going to say causes space and then I'm going to open up more
pointy brackets that say damage and I'm going to put 13 more pointy brackets with a slash.
So that closes the damage formatting.
I really wish I could zoom in and show you this closer and then after the 13, I'll put a space there.
I'm going to use the default formatting again.
Afterwards and say damage.
And now I'm going to go ahead and hit enter.
And hit.
Compile.
And look at that.
Now we see causes 13 damage and the 13 is pinkish red.
Thanks to that color that I set here, it's a little bit maybe too pink.
We'll make it a little bit.
More like that.
Let's hit compile and there we go.
So now we're seeing something really special.
Because if we have these formatting styles that we can automatically use for individual pieces of the
string, then we can say a whole bunch of things about our ability and change the style right there
in line in the text without having to have a bazillion different text widgets inside of it.
So this is actually really powerful.
We can have the formatting just inside of the string or the text.
So now that we have a rich text style, let's add a few styles to this and we'll use those all throughout
our descriptions.
So what are some things we can show about a given ability?
We can show how much damage it causes.
We can show a percent of something.
If our ability calculates a percentage, we can show the time that it takes for something to happen.
We can show the manacost the level, the title of the ability, its cooldown, whatever we want.
So I'm going to add several styles to this.
For one, I'd like to be able to show percentages, so I'm going to make a style called percent.
And it's also going to be the amaranth font.
It's also going to be 16 font size.
We could even have the percentage font be smaller.
We'll make it 14.
Then I'm going to give it a outline of one.
And for the color.
I'm going to make the percentage, maybe sort of this kind of color, something like this, maybe even
a peach color kind of.
So whenever we display percentages, we'll use that color.
Let's add another one.
I'm going to have one for time.
Time can be Amarant Fonte.
I'll make the size 14 for time as well.
So a little smaller.
Outline size of one and I'll make time a little bit greenish, a little bit light green.
I'm also going to add a manacost style.
Actually manacost.
Not cast.
There we go.
And all of these numerical related ones will have a size of 14.
They're all going to be amarant and they'll all have an outline size of one.
But Mana should be, you guessed it, it's going to be blue.
It's going to make it light blue, though.
I'd like a level style so we know that we're talking about level here.
It's going to be amaranth.
These are all going to be numerical values.
And the numerical values I'm going to put at a smaller font size level can also be kind of green, but
we'll make it maybe turquoise green.
Now I want a style for the title and the title is going to be different.
So this one will be called Title.
Now, the title is going to be a different font.
I'm going to go down to Pirata one.
I'm going to make the font size bigger for the title.
The outline size can still be one, but the titles color is going to be probably closer to one of these
colors.
Almost the same as the percentage, but.
Maybe even.
A little more orange.
Now I want to show Cooldowns as well, so I'll have a cooldown.
The cooldown style will also be amarant.
It'll be 14 font size outline size one color for cooldown can be maybe purple ish.
So we'll do a color that looks more like this.
And finally, I'm going to have one last style.
And I'm going to call this style small.
And this will be a different font too.
I'm going to choose, say, David Lieber, regular.
We'll see what that looks like and I'll set it to a size of 14.
Outline size one and I'll give it almost white, because if we want some small text for maybe some kind
of sub description, then we'll have that text there.
Now we can always go back into our rich text block and change these to see the different styles.
For example, I could say cool down.
And instead of using damage, I can change this to use the cooldown.
Like this.
And if I compile, we see the cooldown is purple.
Pretty cool.
Okay, so now we have rich text styles in our rich text blocks, and all we need to do is have descriptions
for each ability that show various aspects of what the ability does.
And this is something that the ability class itself should probably have, either the ability class
or the data asset.
But I'd like the ability class to have it because if we put something on or a gameplay ability for the
description, then we can override that in child classes to have the description appropriate for that
specific ability.
So in the next video we're going to add an ability description for this level and next level, and then
we'll make sure to broadcast that information to the spell menu whenever we select an icon and that
way we can see its description, we can see its level.
If we spend a point on it, we can see that in the menu as well.
So this is a really important aspect of our spell menu.
So we'll take care of that in the next video.
I'll see you soon.