Hey, all. It's been some time. Alright; here it goes!
I have this script that tells the player various things in the menu. They're tiled vertically
"1
2
3"
The thing is though, I would really like them to be tiled horizontally. "1 2 3" Do you all think you could help?
I have this script that tells the player various things in the menu. They're tiled vertically
"1
2
3"
The thing is though, I would really like them to be tiled horizontally. "1 2 3" Do you all think you could help?
Code:
module DarkOdyssey
MenuVIcons = [131,147,188]
MenuVTexts = ['$game_variables[999].to_s','$game_party.gold','time']
end
class Window_DOMenuVar < Window_Base
def initialize(x, y)
super(x, y - 0, 160, WLH * DarkOdyssey::MenuVIcons.size + 32)
refresh
end
def time
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
if hour >= 1
return sprintf("%01d:%02d:%02d", hour, min, sec)
else
return sprintf("%01d:%02d", min, sec)
end
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.windowskin = Cache.system('window')
y = 0
for i in 0...DarkOdyssey::MenuVIcons.size
self.contents.draw_text(0, y, 128, WLH, eval(DarkOdyssey::MenuVTexts[i]), 2)
draw_icon(DarkOdyssey::MenuVIcons[i], 0, y)
y += WLH
end
end
def update
super
refresh if Graphics.frame_count / Graphics.frame_rate != @total_sec
end
end
class Scene_Menu
alias darkodyssey_menuvariables_start start
def start
darkodyssey_menuvariables_start
@gold_window.dispose
@gold_window = Window_DOMenuVar.new(0,384 - 24 * DarkOdyssey::MenuVIcons.size)
end
alias darkodyssey_menuvariables_update update
def update
darkodyssey_menuvariables_update
@gold_window.update
end
end