03-02-2011, 10:35 PM
You wouldn't want to inherit from a more complex class like Scene_Item, as it is designed specifically to create an item menu. But if you are using the RMXP SDK, they created a Scene_Main which is a skeleton which you can inherit from. It would fill in the blanks for things like main, update... stuff you don't need to recreate.
It is like how the window classes (Window_Selectable, Window_Help) inherit basic features from Window_Base... that way you don't have to recreate the text_color, normal_color and the like methods.
BUT... if you do perform an inherit, like 'Window_Fred < Window_Base', you can still recreate your own methods. What I mean is .... Hehe... FRED here inherits the methods from Window_Base. But if I wanted to have a different def normal_color method, I could add it in. My 'new normal_color' only shows in the Fred window while all the other windows would use the default one.
Also, there's a command called 'Alias' that you may like to learn about. It attaches code to existing methods.
Like... hrm...
This little scriptette adds a statement that changes the font for that particular window, and then runs the regular 'refresh' method. This saves you the effort of retyping the whole thing.
It'll take some practice. But hey... you're starting.
It is like how the window classes (Window_Selectable, Window_Help) inherit basic features from Window_Base... that way you don't have to recreate the text_color, normal_color and the like methods.
BUT... if you do perform an inherit, like 'Window_Fred < Window_Base', you can still recreate your own methods. What I mean is .... Hehe... FRED here inherits the methods from Window_Base. But if I wanted to have a different def normal_color method, I could add it in. My 'new normal_color' only shows in the Fred window while all the other windows would use the default one.
Also, there's a command called 'Alias' that you may like to learn about. It attaches code to existing methods.
Like... hrm...
Code:
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
alias new_refresh refresh
def refresh
self.contents.font.name = "Times New Roman"
new_refresh
end
end
This little scriptette adds a statement that changes the font for that particular window, and then runs the regular 'refresh' method. This saves you the effort of retyping the whole thing.
It'll take some practice. But hey... you're starting.