Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

HBGames

I am making my own HUD for Lost fantasy. I have the first window of it made, for skills. I need it to be shown on the map always unless there is a battle or the menu is opened. I also need the map to be shown in the background.

How can I do this?

Here is the window and scene script so far:

#--------------------------
# Scene_Hud
#--------------------------

class Scene_Hud
#-----------------
# Main processing
#-----------------

def main
#Call window
@window = Window_HudSkills.new
#Transition
Graphics.transition
#Main loop
loop do
#Update game screen
Graphics.update
#Update input info
Input.update
#Frame update
update
#Abort loop if screen is changed
if $scene != self
break
end
end
#Prepare for transition
Graphics.freeze
#Dispose of windows
@window.dispose
end

#-------------------
# Frame update
#-------------------

def update
# Update windows
@window.update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to Menu screen
$scene = Scene_Map.new
return
end
end
end

#----------------------------------------
# Window_HudStats
#----------------------------------------

class Window_HudSkills < Window_Base
#----------------------------------------
# Object Initialization
#----------------------------------------
def initialize
super(421, 0, 219, 100)
self.contents = Bitmap.new(width - 2, height - 2)
refresh
end

def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = 16
#Fishing
fishlvl = $game_variables[8]
#Cooking
cooklvl = $game_variables[26]
#Hunting
huntlvl = $game_variables[29]
#Alchemy
alclvl = $game_variables[32]
#Agility
agilvl = $game_variables[35]
#-------------------------
#Text coding and placement
#-------------------------
self.contents.draw_text(35, 7, 50, 25, "#{fishlvl}")
self.contents.draw_text(100, 7, 50, 25, "#{cooklvl}")
self.contents.draw_text(165, 7, 50, 25, "#{huntlvl}")
self.contents.draw_text(35, 38, 50, 25, "#{alclvl}")
self.contents.draw_text(100, 38, 50, 25, "#{agilvl}")
#--------------------------
#Image coding and placement
#--------------------------
@bitmap = RPG::Cache.icon("fish.png")
self.contents.blt(7, 4, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160)
@bitmap = RPG::Cache.icon("fo8.png")
self.contents.blt(71, 4, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160)
@bitmap = RPG::Cache.icon("005-weapon05.png")
self.contents.blt(141, 4, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160)
@bitmap = RPG::Cache.icon("skill_022.png")
self.contents.blt(7, 35, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160)
@bitmap = RPG::Cache.icon("020-accessory05.png")
self.contents.blt(71, 35, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160)
end
end

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top