ページ 1 / 1
【解決済み。ありがとうございます】メニュー画面に変数複数表示
Posted: 2017年5月21日(日) 10:32
by kii
間違えて依頼の方に投稿してしまったので再投稿します。
どなたかメニュー画面に変数複数表示する方法をご存知であれば教えていただけると大変助かります。
こちらのスクリプトで一つだけ表示出来るのですが二個三個となるとやりかたがどうしてもわからなくて投稿しました。
初めてなので至らない点もあると思いますがよろしくお願いします。
http://pricono.whitesnow.jp/project/rgs ... indow.html
Re: 【RGSS3】メニュー画面に変数複数表示
Posted: 2017年5月21日(日) 17:59
by TOMO
行数(ウィンドウの高さ)は
fitting_height(2)の数値を弄れば調整できます
変数表示は、こちらを参考に頑張って作ってください
http://tm.yumineko.com/viewtopic.php?f=43&t=3658
どうしても分からなければ、こちらをどうぞ
コード: 全て選択
module MenuVariable
List = [
{:text => "変数ID:1", :id => 1, :unit => "Pt"},
{:text => "変数ID:2", :id => 2, :unit => "Pt"}
]
end
class Window_MenuVariable < Window_Base
def initialize
super(0, 0, 160, window_height)
refresh
end
def window_height
fitting_height(MenuVariable::List.size * 2)
end
def refresh
contents.clear
MenuVariable::List.each_with_index do |list, index|
rect = Rect.new(0, line_height * index * 2, contents_width, line_height)
change_color(system_color)
draw_text(rect, list[:text])
change_color(normal_color)
rect.y += line_height
rect.width -= text_size(list[:unit]).width
draw_text(rect, $game_variables[list[:id]], 2)
change_color(system_color)
rect.x += rect.width
rect.width = text_size(list[:unit]).width
draw_text(rect, list[:unit])
end
end
end
class Scene_Menu < Scene_MenuBase
alias menu_variable_create_gold_window create_gold_window
def create_gold_window
menu_variable_create_gold_window
@variable_window = Window_MenuVariable.new
@variable_window.x = 0
@variable_window.y = @gold_window.y - @variable_window.height
end
end
Re: 【RGSS3】メニュー画面に変数複数表示
Posted: 2017年5月21日(日) 18:12
by kii
TOMO様迅速な回答ありがとうございます!出来ました!
本当に助かりました。ありがとうございます。必ず完成させます。