Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

I need help to find what makes this script doesn't work

Code:
class Advance_Window < Window_Base
  
  def inititalize(x, y, column, row, items = ["A", "B"])
    @column_max = column
    @row_max = row
    @cursor_pos = [0, 0]
    @items = items
    super(x, y, (96 * @column_max) , (@row_max * 64))
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.draw_text(0, 0, 32, 32, @column_max.to_s) #This line just tests if 'column' argument is passed or not
  end

#some codes here.. but not important for this question

end


Then i made a new scene.. and I inserted script like this :
Code:
Advance_Window.new(0, 0, 4, 2)
but I got no window on my screen. I was expecting that I get a window with (4 * 96) width and (2 * 64) height.

Then I changed the script into this :
Code:
Advance_Window.new(0, 0, 120, 120)
And I get a 120 * 120 window. Without any text. remember i put 'self.contents.draw_text(0, 0, 32, 32, @column_max.to_s)' in the script?

It seems that the arguments were not passed into the variables I made in the script. How could this happen?
Sorry I'm still newb.



EDIT :
Umm.. nevermind I found it
its here 'def inititalize(x, y, column, row, items = ["A", "B"])'

close or delete this topic is okay
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top