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.

Display/update a window

Banshi

Member

I'm at a lose here. I've checked around, but I can find/understand anything to help. Anyhow, I started with RGSS yesterday and got far enough to get it to display a window, but a few problems arose. First, how do you update it? And second, if i call it through an event, it apears and works fine, but if the event is parrallel process, it apears, and then disapears shortly after, or just dosnt work.

I'm tring to make my own battle system, mostly through events, and the window is there solely to provide info on Hp, Sp, and such... but if you can't see your life, I dont think it will work well...

If you could spare the time to aid a poor confused person, any help would be apreciated.

Thanks.


Here's the remedial script if it will help...
class My_Window4 < Window_Base

def initialize
super(0,0,680,520)
self.z = 9998
self.opacity = 0
self.contents = Bitmap.new(width - 16, height - 16)
self.contents.font.name = "Viner Hand ITC"
self.contents.font.size = 24
self.contents.font.color = Color.new(0, 0, 0, 200) #text color (r,g,b,a)
refresh
end

def refresh
self.contents.clear # Clear up contents on each refresh
if $game_party.actors.size>=1
self.contents.draw_text(416, 346, 128, 24, "" + $game_party.actors[0].hp.to_s + "") #hp h1
self.contents.draw_text(448, 346, 128, 24, "| " + $game_party.actors[0].maxhp.to_s + "") #hp h1
self.contents.draw_text(575, 344, 128, 32, "" + $game_party.actors[0].sp.to_s + "") #mp h1
else
end
if $game_party.actors.size>=2
self.contents.draw_text(416, 378, 128, 24, "" + $game_party.actors[1].hp.to_s + "") #hp h2
self.contents.draw_text(448, 378, 128, 24, "| " + $game_party.actors[1].maxhp.to_s + "") #hp h2
self.contents.draw_text(575, 374, 128, 32, "" + $game_party.actors[1].sp.to_s + "") #mp h2
else
end
if $game_party.actors.size>=3
self.contents.draw_text(416, 410, 128, 24, "" + $game_party.actors[2].hp.to_s + "") #hp h3
self.contents.draw_text(448, 410, 128, 24, "| " + $game_party.actors[2].maxhp.to_s + "") #hp h3
self.contents.draw_text(575, 404, 128, 32, "" + $game_party.actors[2].sp.to_s + "") #mp h3
else
end
if $game_party.actors.size>=4
self.contents.draw_text(416, 442, 128, 24, "" + $game_party.actors[3].hp.to_s + "") #hp h4
self.contents.draw_text(448, 442, 128, 24, "| " + $game_party.actors[3].maxhp.to_s + "") #hp h4
self.contents.draw_text(575, 436, 128, 32, "" + $game_party.actors[3].sp.to_s + "") #mp h4
else
end
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