RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Requesting a HUD [Resolved ..again ]

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 88
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.
« Last Edit: February 10, 2007, 10:07:08 PM by kathis »
Project
New project. The other dimention DND
RPG makers challenge http://rmrk.net/index.php/topic,13503.0.html

***
Rep:
Level 88
Never mind I figured it out 

Code: [Select]


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

« Last Edit: February 10, 2007, 10:06:44 PM by kathis »
Project
New project. The other dimention DND
RPG makers challenge http://rmrk.net/index.php/topic,13503.0.html

***
Rep:
Level 88
great.... errors.. or something odd anyway...


this is the project I made the script with
   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?

Project
New project. The other dimention DND
RPG makers challenge http://rmrk.net/index.php/topic,13503.0.html

***
Rep:
Level 88
Random-Idiot
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:

Code: [Select]
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
ALL HAIL ME™

***
Rep:
Level 88
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

Code: [Select]
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
Project
New project. The other dimention DND
RPG makers challenge http://rmrk.net/index.php/topic,13503.0.html