- 664
- Posts
- 16
- Years
- Age 33
- England
- Seen May 16, 2024
Ok, so now we've learnt all about variables, its onto lesson 3 :D
Make sure you've read lesson 1 and 2 first!
Super and Sub Classes
Ok, so there are super classes and sub classes in RGSS, they can inherit or give sort of traits to another class. Much like a family having ginger hair. An example of this is this:
This means that Window_Badger inherits certain traits from Window_Base, the default window script.
So we can use these traits to our advantage in scripts, simply by calling the superclass.
Here's an example.
Ok, so lets explain this for you,
The super shows that we want to call the method with the same name in the superclass, which in this case is Window_Base, and the 4 numbers will be explained now.
1st Number: The location right of the upperleft pixel of the game screen.
2nd Number: The location down of the upperleft pixel of the game screen.
3rd Number: How wide the window is.
4th Number: How tall the window is.
So this shows you how to call the superclass in a method.
Remember, the superclass must ALWAYS be called in the initialize method. (If you don't know what the initialize method is then i suggest you read lesson 2 again)
So now i'll explain the different Super and sub classes for Windows.
It looks sort of like this:
So this means that Window_Base has the properties of Window, Window_Selectable has the properties of Window_Base and Window, and Window_Command has the properties of all three.
So why not just use Window_Command for everything? Simply because it lags up the game alot, so its better to use Window_Base for displaying text or pictures, and Window_Selectable for option choices and stuff. Window_Command is perfect for menus, and i'll show you how to use that in a later tutorial.
Ok so that's basically it for sub and super classes, next tutorial will be on creating windows!
Until then, reaply to this topic if you found it useful!
Make sure you've read lesson 1 and 2 first!
Super and Sub Classes
Ok, so there are super classes and sub classes in RGSS, they can inherit or give sort of traits to another class. Much like a family having ginger hair. An example of this is this:
Code:
Window_Badger < Window_Base
This means that Window_Badger inherits certain traits from Window_Base, the default window script.
So we can use these traits to our advantage in scripts, simply by calling the superclass.
Here's an example.
Code:
super(0, 0, 640, 480)
Ok, so lets explain this for you,
The super shows that we want to call the method with the same name in the superclass, which in this case is Window_Base, and the 4 numbers will be explained now.
1st Number: The location right of the upperleft pixel of the game screen.
2nd Number: The location down of the upperleft pixel of the game screen.
3rd Number: How wide the window is.
4th Number: How tall the window is.
So this shows you how to call the superclass in a method.
Remember, the superclass must ALWAYS be called in the initialize method. (If you don't know what the initialize method is then i suggest you read lesson 2 again)
So now i'll explain the different Super and sub classes for Windows.
It looks sort of like this:
Code:
Window -> Window_Base -> Window_Selectable -> Window_Command
So this means that Window_Base has the properties of Window, Window_Selectable has the properties of Window_Base and Window, and Window_Command has the properties of all three.
So why not just use Window_Command for everything? Simply because it lags up the game alot, so its better to use Window_Base for displaying text or pictures, and Window_Selectable for option choices and stuff. Window_Command is perfect for menus, and i'll show you how to use that in a later tutorial.
Ok so that's basically it for sub and super classes, next tutorial will be on creating windows!
Until then, reaply to this topic if you found it useful!
Last edited: