RGSS3 Huds - The Vertical Equivalent?

● ARCHIVED · READ-ONLY
Started by Milena 6 posts View original ↗
  1. I tried to follow an instruction on how to make my own hud:

    Spoiler
    module HF_Basic Actor_ID = 2endclass HFBasicHorz < Sprite include HF_Basic def initialize(view) super(view) @hp_fill1 = Color.new(34,80,30) @hp_fill2 = Color.new(23,240,0) @hmp_fill1 = Color.new(45,80,80) @hmp_fill2 = Color.new(14,230,240) @floor_bg = Color.new(10,20,20) @floor_bg2 = Color.new(240,240,0) self.bitmap = Bitmap.new(1200,200) self.z = 300 update end def update super self.bitmap.clear hp = $game_actors[Actor_ID].hp mhp = $game_actors[Actor_ID].mhp hud_length_size = 386 * hp / mhp self.bitmap.fill_rect(10, 10, 390, 10, @floor_bg) self.bitmap.fill_rect(11, 11, 388, 8, @floor_bg2) self.bitmap.fill_rect(12, 12, 386, 6, @floor_bg) self.bitmap.gradient_fill_rect(12, 12, hud_length_size, 6, @hp_fill1, @hp_fill2) mp = $game_actors[Actor_ID].mp mmp = $game_actors[Actor_ID].mmp hud_length_size = 386 * mp / mmp self.bitmap.fill_rect(10, 30, 390, 10, @floor_bg) self.bitmap.fill_rect(11, 31, 388, 8, @floor_bg2) self.bitmap.fill_rect(12, 32, 386, 6, @floor_bg) self.bitmap.gradient_fill_rect(12, 32, hud_length_size, 6, @hmp_fill1, @hmp_fill2) end def dispose self.bitmap.dispose super end endclass Spriteset_Map alias hf_basic_initialize initialize alias hf_basic_update update alias hf_basic_dispose dispose def initialize @hfhorz = HFBasicHorz.new(@viewport2) hf_basic_initialize end def update @hfhorz.update hf_basic_update end def dispose @hfhorz.dispose hf_basic_dispose end  
    How can I make a vertical equivalent of this hud? Because I was planning to make the experience gauge and other gauge inside the MenuStatus to be vertical rather than horizontal. Is there a math involved or any thing I should know to make it vertical?
  2. instead of use ox you use oy method
  3. instead of modifying the length part and having the height static, you simply interchange the two... basically interchange the hud_length_size and the 6, then possible change the 6 if you want the width to be wider plus adjust the hud_length_size computation (it's on a few lines to the top)... and also adjust the first few fill rects making the height larger than the width


    plus of course you might want to adjust the x,y too (the first two values on all the fill_rect thingies...


    fill_rect takes (x,y,width,height,blahblah) btw


    @nio - there's no ox on that script... and it's just for origin right?
  4. Nio:

    Should't that be only for Planes? Like:

    @burger = Plane.new@burger.bitmap = Cache.title1("Crystal")@burger.oy += 10What I want to achieve is that I want the Hud to go vertically instead of the common gauges that goes horizontally.

    @Shana:

    I'll try that. 

    PS: It works, now my problem is having their background going vertical too. this would be a breeze, thanks! How about for gauges? They have a different config, so what if i want to make the HP and MP go vertical in MenuStatus?
  5. most default gauges also just use fill_rect on the actual drawing part so you can easily modify them as long as you remember the parameter set-up of fill_rect (which is also on the help file btw) and gradient_fill_rect (also on the help file)


    the key is simply making the width component static while turning the height component dynamic and viola you now have a vertically filling gauge...
  6. oups xD Sorry I mistake it accidently ._.'