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.

Gradient Bar Problems and Variable Text Problems

I'm just having two main probelms at the moment.

1. I've got a gradient bar script but don't know how to put a gradient bar on the map to show the current Player's Hp and Sp, and then easily be erased.

2. I don't know how to show text with a certain variable constantly at a certain xy while other things can be going on, and then easily be erased.

Please help guys.

Thanks in advance

Micklo
 
You can make a window, with a transparent background.
Code:
class Window_HUD < Window_Base
  def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    self.back_opacity = 0
    refresh
  end
  def refresh
    self.contents.clear
    if $game_switches[#] == true # Change the # for the number of the switch that will be use for show the "Text"
      self.contents.draw_text(x, y, 120, 32, "Text") # Change x, y
    end
    if $game_switches[#] == true # Change the # for the number of the switch that will be use for show the bars
      self.contents.draw_gradient_bar_hp # The name of the method of your gradient bar for hp
      self.contents.draw_gradient_bar_sp # The name of the method of your gradient bar for sp
    end
  end
end
And for creating the window, put in Scene_Map, over the main loop:
Code:
@window_hud = Window_HUD.new
Put this below the main loop:
Code:
@window_hud.dispose
 
Please may you explain the bit about:

if $game_switches[#] == true # Change the # for the number of the switch that will be use for show the bars
self.contents.draw_gradient_bar_hp # The name of the method of your gradient bar for hp
self.contents.draw_gradient_bar_sp # The name of the method of your gradient

I don't quite understand what I have to do here!

Micklo
 
Code:
if $game_switches[#] == true # Change the # for the number of the switch that will be use for show the bars
This is for the easy erase, change the # to the number of the switch that you will use for show and erase the Text and gradient bars. So, if the switch "#", is activated, the bars will be showed, if it is deactivated the bars will not be showed.
The same goes for:
Code:
if $game_switches[#] == true # Change the # for the number of the switch that will be use for show the "Text"
but it will show and not show the text.

Code:
self.contents.draw_gradient_bar_hp # The name of the method of your gradient bar for hp
self.contents.draw_gradient_bar_sp # The name of the method of your gradient bar for sp
You say that you have got a script that makes gradient bars. You must reemplace the "self.contents.draw_gradient_bar_hp" with the method of the gradient bars script, that show the hp gradient bar. It is the same for "self.contents.draw_gradient_bar_sp", but with the sp gradient bar method.

If you don't know how to do it, post your gradient bar script.
 

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