[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,230
Reaction score
3,072
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

That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:
Trying to make it so my map is cleared of "random" events after the player leaves the map... to little success >.<
Had my first interaction with a legit homophobe concerning one of my games today. Tempting to engage, but pointless.
The BIGGEST immersion breaker for Sword Art Online is that Kirito keeps finding overpowered playstyles using "bad things nobody uses cuz its bad". Players WILL use bad gear BECAUSE it's bad.
When I said I'd make 20 games in 2020, I scared myself. Now it's mid-February, and I've made 6 games. So I got this. But, then again...do I got this?

Forum statistics

Threads
94,238
Messages
919,286
Members
123,944
Latest member
ally_dwight
Top