[RGSS2] Window Selectable Problem

Straight to the point:

 

So I created a  selectable window which has 5 items to select with(command1..command5), I adjusted the window height to 100 so at first you can only see 3 commands(command1..command3). See image below.

Spoiler
[IMG]http://s6.postimg.org/cm5owuhvx/Untitled.jpg[/IMG]
if you press down key further more, you should be able to see command4 and command5. but look...

Spoiler
[IMG]http://s6.postimg.org/wut2ikh75/untitled2.jpg[/IMG]
If i try to resize the window height to 200, command 4 and 5 will be visible

Spoiler
[IMG]http://s6.postimg.org/mm0lcqt5d/Untitled3.png[/IMG]
here is the command1...command5 script

Spoiler
class Window_Select < Window_Selectable def initialize super(10,10,160,100) # set window position and size @options = ["command1","command2","command3","command4","command5",] # selectable items @item_max = @options.size # number of selectable items refresh self.index = 0 # this is just for the default positioning of cursor end def refresh for i in 0...@item_max draw_item(i) end end def draw_item(index) rect = item_rect(index) self.contents.draw_text(rect, @options[index]) end endclass Scene_Select < Scene_Base def start @window_select = Window_Select.new end def update @window_select.update if Input.trigger?(Input:: #Sound.play_cancel $scene = Scene_Map.new end end def terminate @window_select.dispose end end 
I didn't actually notice this until I created my party system, the actors can be selected but their names aren't visible on window selectable.

Spoiler
[IMG]http://s6.postimg.org/bqdsv4xld/party_bug.jpg[/IMG]
Am I missing a line of code here? Or this is just a faulty coding. Thanks in advance.
Call create_contents before you start drawing stuff.


Your bitmap is too small for the number of items you are trying to draw.
Oh yes, problem solved, thank you very much.

Original thread: https://forums.rpgmakerweb.com/threads/rgss2-window-selectable-problem.16114/