Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Help improving my hud

Save-Point

Full Version: Help improving my hud
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I am working on improving my HUD which is currently made with images. I am fine with using images as I have not found a hud that suits my taste, which is picky. However, I would like a way to make the life bar part appear in a different way. Something possibly more fluid. It loads fine with pictures. The pieces generate through changing opacity of each individual piece (25 pieces cut by shaky hand in PS). Which is fine, but who doesn't want to do things a better way if possible. It doesn't lag so this is just to improve my own work if possible.

[Image: CGn4BBvUIAA2f1j.png:large]

Code:
module FOE_HUD
 
 Life_Divide_Pieces = 0.04
 Life_Range_MIN = 44
 Life_Range_MAX = 70  
 
end

class HUD < Window_Base
 
 include FOE_HUD
 
 def initialize
   super(0, 0, 480, 200)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.opacity = 0
   self.visible = $world_ai.show_hud
   hud_variables
   hud_sprites
   refresh
 end
 
 def refresh
   self.contents.clear
   refresh_sprites
 end
 
 def hud_variables
   @hud_data = {}
   @hud_sprites = []
   
   @hud_data["Name"] = $partners.members[0].name
   @hud_data["Life"] = $partners.members[0].vitality
   @hud_data["MaxLife"] = $partners.members[0].maxvit
   @hud_data["Eneg"] = $partners.members[0].energy
 end
 
 def hud_sprites
   for i in 0...106
     @hud_sprites[i] = Sprite.new
     @hud_sprites[i].opacity = 0
     @hud_sprites[i].visible = self.visible
   end
 end
 
 def refresh_sprites
   # Bottom
   @hud_sprites[0].bitmap = Bitmap.new("Graphics/Hud/HudSpiralBase.png")
   @hud_sprites[0].color = Color.new(89,89,89,255)
   @hud_sprites[0].opacity = 255
   # Life Bar
   for i in 45..70
     @hud_sprites[i].bitmap = Bitmap.new("Graphics/Hud/HudLifeBar0#{i}.png")
     @hud_sprites[i].color = Color.new(91,186,250,255)
   end
   # Life Bar Border
   @hud_sprites[71].bitmap = Bitmap.new("Graphics/Hud/HudLifeBar.png")
   @hud_sprites[71].opacity = 255
   #@hud_sprites[74].bitmap = Bitmap.new("Graphics/Hud/HudEnergyBar074.png")
   # Energy Bar
   #for i in 75..99
   #  @hud_sprites[i].bitmap = Bitmap.new("Graphics/Hud/HudEnergyBar0#{i}.png")
   #end
   # Top
   @hud_sprites[105].bitmap = Bitmap.new("Graphics/Hud/HudSpiralTop.png")
   @hud_sprites[105].opacity = 255
 end
 
 def update
   self.contents.clear
   @hud_data["Name"] = $partners.members[0].name
   @hud_data["Life"] = $partners.members[0].vitality.round
   @hud_data["MaxLife"] = $partners.members[0].maxvit
   @hud_data["Eneg"] = $partners.members[0].energy
   draw_name
   draw_life
   draw_energy
   # Life Bar Maintenance
   value_of_pieces = $partners.members[0].maxvit * Life_Divide_Pieces
   number_of_pieces = $partners.members[0].vitality / value_of_pieces
   life_range_toshow = (Life_Range_MIN + 1) + number_of_pieces.round
   for i in 45..70
     if i <= life_range_toshow
       @hud_sprites[i].opacity += 10 if @hud_sprites[i].opacity < 180
     else
       @hud_sprites[i].opacity -= 10 if @hud_sprites[i].opacity > 0
     end
   end
 end
 
 def draw_name
   self.contents.draw_text(100,26, 140, 14, @hud_data["Name"], 2)
 end
 
 def draw_life
   self.contents.draw_text(100,43, 140, 14, @hud_data["Life"].to_s+"/"+@hud_data["MaxLife"].to_s, 2)
 end
 
 def draw_energy
   self.contents.draw_text(100,60, 140, 14, @hud_data["Eneg"].to_s, 2)
 end
 
 def dispose
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   for sprite in @hud_sprites
     sprite.dispose
   end
 end
 
end
I would recommend not using fuchsia on a blue background. The contrast hurts my eyes really badly and I cant read a thing.

To be honest with you, your health bar looks good: reminds me of Kingdom Hearts a bit. And if it works the way you have it now, why change it? Sure you could probably script it using another approach, but don't get hung up on something that isn't broken. :P
(06-04-2015, 05:44 AM)thephantom Wrote: [ -> ]I would recommend not using fuchsia on a blue background. The contrast hurts my eyes really badly and I cant read a thing.

To be honest with you, your health bar looks good: reminds me of Kingdom Hearts a bit. And if it works the way you have it now, why change it? Sure you could probably script it using another approach, but don't get hung up on something that isn't broken. :P

Sorry, I have an affinity for blue. There are eight or so colors for the event log and the the life was green. I can just change it back. And night time has a blue tone so yea its a lot of blue. recommendation noted. oh, just notice task bar blue too...good morning photo shop.
Its the fuchsia I would change, I like the blue background too!
Anything red based (purple, pink, fuchsia) is gonna have problems on blue.
In theory orange should too, but it doesn't seem as bad when you make it more yellow.
Sounds like green or yellow is the way to go.
Why not make the pink text white instead? It would have the strongest contrast and you already have white text there.

What will each type of message in that box be coloured?