[RGSS2] Window Selectable Problem

flixbeat

♫ Music, ❀ arts and ¶ codes.
Member
Joined
Jul 29, 2013
Messages
5
Reaction score
0
First Language
Filipino
Primarily Uses
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.

if you press down key further more, you should be able to see command4 and command5. but look...

If i try to resize the window height to 200, command 4 and 5 will be visible

here is the command1...command5 script

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.

Am I missing a line of code here? Or this is just a faulty coding. Thanks in advance.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Call create_contents before you start drawing stuff.


Your bitmap is too small for the number of items you are trying to draw.
 
Last edited by a moderator:

flixbeat

♫ Music, ❀ arts and ¶ codes.
Member
Joined
Jul 29, 2013
Messages
5
Reaction score
0
First Language
Filipino
Primarily Uses
Oh yes, problem solved, thank you very much.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top