Hey, so here's my code, pretty simple since I've just started it;
Obviously it's going to change and show more info when I've done, but I've got a few... problems/requests.
Right now, I've got it set to a common event, when a switch is turned on, the HUD shows up, and when I display text (Someone talking) I turn the switch off to remove the HUD so it doesn't get in the way, it's working fine with a common event, but having to place the event in every map seems like a pain in the arse, and I'd like to know how to do this through the script, since I can't remember how to do it, lol. Basically, simpler explanation, the HUD only shows while a switch is turned on.
Also, I don't like the windowskin around the hud, now I've tried changing this with back_opacity = 0, but that's just not giving me any results whatsoever, any help here?
Last question, how would I display an image in the window based on a variable? I'm trying to display hearts in it (Lives obviously), I'm wanting to include 3 hearts in a row, and like, if the variable (lives) is equal to 3, all 3 show up, if it's 2, get rid of one of 'em, if 1, get rid of 2 of 'em, and so on like that. I could do this with events and pictures, but I'd rather do it inside a script since it'd make my life easier... I assume.
So yeah, I've not got much done (It's basically just a copy/paste job from another window and change stuff, lol...), but hopefully with help, I'll have something presentable.
Code:
#==============================================================================
# ** Window_HUD
#------------------------------------------------------------------------------
# This window displays the HUD
#==============================================================================
class Window_HUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize
super(32, 64, 480, 96)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for actor in $game_party.members
draw_actor_name(actor, 0, 4)
end
self.contents.draw_text(120, 0, 120, 32, "Hello")
end
end
Obviously it's going to change and show more info when I've done, but I've got a few... problems/requests.
Right now, I've got it set to a common event, when a switch is turned on, the HUD shows up, and when I display text (Someone talking) I turn the switch off to remove the HUD so it doesn't get in the way, it's working fine with a common event, but having to place the event in every map seems like a pain in the arse, and I'd like to know how to do this through the script, since I can't remember how to do it, lol. Basically, simpler explanation, the HUD only shows while a switch is turned on.
Also, I don't like the windowskin around the hud, now I've tried changing this with back_opacity = 0, but that's just not giving me any results whatsoever, any help here?
Last question, how would I display an image in the window based on a variable? I'm trying to display hearts in it (Lives obviously), I'm wanting to include 3 hearts in a row, and like, if the variable (lives) is equal to 3, all 3 show up, if it's 2, get rid of one of 'em, if 1, get rid of 2 of 'em, and so on like that. I could do this with events and pictures, but I'd rather do it inside a script since it'd make my life easier... I assume.
So yeah, I've not got much done (It's basically just a copy/paste job from another window and change stuff, lol...), but hopefully with help, I'll have something presentable.