I really didn't want to do this but I have no choice >.> been having problems trying to make my own... Here is what I need
I need a HUD that will display Varibles such as varible 1 varible 2 and varible 3 I also need to have a place to input the name of each varible. (trying to leave this universal so other people can use it if they need to.
Never mind I figured it out
class Window < Window_Base
def initialize
super(0,0,250, 85)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 145 #Change to 0 if you use a picture
refresh
end
def refresh
self.contents.clear
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
# Energy
self.contents.font.color = system_color
self.contents.draw_text(2,0,120,32, "Energy", 0)
self.contents.font.color = normal_color
#$game_variables[1] notice how the number is 1 change this to what ever varible energy is
self.contents.draw_text(90,0,120,32, $game_variables[1].to_s, 0)
self.contents.font.color = system_color
# Knownledge
self.contents.font.color = system_color
self.contents.draw_text(2,15,100,32, "Knowledge", 0)
self.contents.font.color = normal_color
#$game_variables[1] notice how the number is 1 change this to what ever varible energy is
self.contents.draw_text(90,15,120,32, $game_variables[2].to_s, 0)
# Reputation
self.contents.font.color = system_color
self.contents.draw_text(2,30,100,32, "Reputation", 0)
self.contents.font.color = normal_color
#$game_variables[1] notice how the number is 1 change this to what ever varible energy is
self.contents.draw_text(90,30,120,32, $game_variables[3].to_s, 0)
end
def update
super
refresh
end
end
class Scene_Map
alias hud_main main
alias hud_update update
def main
@hud = Window.new
hud_main
@hud.dispose
end
def update
@hud.update
hud_update
end
end
great.... errors.. or something odd anyway...
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi169.photobucket.com%2Falbums%2Fu224%2Fhero5th%2Fproject1.jpg&hash=f6179bce2668f7f21de4de611ca0f6d9ef0a6035) this is the project I made the script with
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi169.photobucket.com%2Falbums%2Fu224%2Fhero5th%2Fproject2.jpg&hash=423cff762d41f6b9c3bed3f550a0b7e6d4e82cbe) THIS is a NEW project and the script I posted above is exactly the same
I don't get it Why are both projcct with same code having problems like this? What have I done incorrectly -_- Please help so I can fix my script?
If you are using the illegal version, it is obvious. In the old project you have the fix in main, in the new one you don't. Howeverm I cleaned up your code:
class Window_HUD < Window_Base
def initialize
super(0,0,250,90)
self.contents = Bitmap.new(width - 32, height - 32)
# 160 is the semi-opaque value (like window_message)
self.back_opacity = 160
$game_variables[1] = 10000
refresh
end
def refresh
# Clear bitmap's contents
self.contents.clear
# Setting font color, most effcient is writing all at once in this color
self.contents.font.color = system_color
# Bitmap#draw_text(x,y,width,height,text,align=0) can leave the 0
self.contents.draw_text(4,-5,250,32,"Energy")
self.contents.draw_text(4,13,250,32,"Knowledge")
self.contents.draw_text(4,30,250,32,"Reputation")
# Setting font color, most effcient is writing all at once in this color
self.contents.font.color = normal_color
# align 0 => left, 1 => center, 2 => right
self.contents.draw_text(0,-5,250-32,32, $game_variables[1].to_s, 2)
self.contents.draw_text(0,13,250-32,32, $game_variables[2].to_s, 2)
self.contents.draw_text(0,30,250-32,32, $game_variables[3].to_s, 2)
end
def update
super()
refresh
end
end
class Scene_Map
alias hud_main main
alias hud_update update
def main
@hud = Window_HUD.new
hud_main
@hud.dispose
end
def update
@hud.update
hud_update
end
end
Just a catch up so people know what happened. when I tried that the same problem accord so I copyed the font and size he wanted me to change into my main. Well the Hud worked but everything that worked with letters and font vanished. So we added this to the HUD code
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
and changed the main back. Surprsingly it worked. Oddly that code I put in code tags is suppose to be the defult. Odd but true oh well it works now so I am just going to add that to the orignal script code and change the title of this topic once again