Just for your example if you wanted to pass more variables into a class, (which I would try to keep to a minimum.) all you have to do is extend the list inside the brackets.
then set whatever value the method is passed to a variable to use it or you can even pass those values directly to another method if it is being called by that method. (Like the "super" method inside of the method below.
The widow_width and window_height below in green are methods that are handled by the inherited class. So to better explain you can also pass methods into method as long as they return a value. As both of those do (or should. Also if you redefine a method inside of your class, it will pass the new method.)
def initialize(x, y, actor_name, actor_face, yada, di, da) super(x, y, window_width, window_height) @actor_face = actor_face @actor_name = actor_name @pending_index = -1 example_method(@actor_face, @actor_name, yada, di, da, refresh)end
Code:
def draw_item(index) actor = $game_actors[index+1] p actor return if actor.nil? rect = item_rect(index) draw_item_background(index) draw_actor_face(actor, rect.x + 1, rect.y + 1) draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)end
I am not sure if you are still using this but you shouldn't need to use +1 anymore with compact. You should print your actors to make sure that they are indeed the actors too and make sure they are the right ones. That might be a couple reasons for your '"face_name" Nil.' error.