 This video was brought to you by my patrons. Thank you so much for your support. Hello there, I want to share a small tip with you. That is the use of set and get to encapsulate information from outside a class. I have here a sliding panel that is basically a panel that displays a title and a description, right? You can say this just by watching what this class is displaying. So everything that you have to know is, well, how do I set this title and how do I set this description? So this is everything that you have to know, right? If we go here into this Monteser class, which is basically just a way to control the game flow, what it does is, let me expand this, it connects a method here, a signal actually, to a method. And in this method, let me hide this fold, actually, what this method does is that it takes this panel, this sliding panel, and it sets the description and the title to be the achievement description and the achievement title. And then it shows it. Very simple, right? It sets the description and the title directly. But we know that we can't just say that. We can just set a string and then it will suddenly appear in the screen. We know that we should use at least a label for that. So a label node, and this label node has a text property that you have to access. But this is actually meaningless from outside the label class. Actually, what you want to do is just set the description and the title. So if I go back here in the slide panel, I will open the scene. You can see that it is way more complex than it seems. It has a twin, it has an idle time, it has a margin container, a box container, and then we have the title and the description, which is what we want to access from outside of it. So if I open here this, let me fold everything here and open the distraction-free mode. You can see that the title and the description labels are encapsulated into these variables. And then we have a setter and a getter method to encapsulate the access to this variable. But you can see that we have here is the path to the label. So it's the object of the label. But from here, we are setting a string, right? So what I did here is that, okay, you can set the text, the title and the description using a string. It's okay to do that. But I'm hiding from outside this class that what you are actually doing is that you are going to this node that is in this title and you are setting this label text property to be this string that you are passing to this node. So you are hiding all of this information by encapsulating this title with these methods. So if you go here in the get title, it basically does the same. You are hiding this path from outside this class using just this title property here, this title variable, and it returns the text of this label. So you are hiding everything that's not important from outside this class into these two variables here. So the interaction with this class is very, very simple from outside of it. So if I go here into the Monteser, what I did here is that on the ready, I just want to test this. I am completing an achievement and since this achievement will be completed, it will emit this signal. This achievement node will emit this signal and it will call this function passing the achievement name. So the panel will set its description and its title to be these variables of this achievement, and then it will show itself. The show method, I used polymorphism to encapsulate this twinning here, so it's an animation. I can show this to you, let me go here and test the scene. It's basically this animation, but from outside of this class, it will interact just as if it is interacting with a simple control node. It just has to say show yourself or hide yourself. So the hide method is also encapsulated and I use polymorphism to add some procedures and then call the superclass hide method. Let me take rid of this. And if I go here back to the game scene, when I complete an achievement, it will automatically show this panel with the description and the title already set. So if I play here, there we have it. Full cheese, play Monteser on a full moon day. So that's it. I hope you enjoyed. It's a small tip that can help you a lot making classes because now if you change the way that your scene is structured, if you want to change or add more control nodes here and hide this title and label nodes from outside these classes, you can basically just change the path here. The outside world interaction will keep the same, right? That's it. It's a very, very good tip and I hope that you use it because it will help you keep your code simpler and more scalable. So that's it. Thank you for watching. Keep developing and to the next time.