• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Showing information in FL's Simple Hud...

Qwertyis666

Dragon Trainer Since 1996
60
Posts
10
Years
  • Hi, Someone can help me with the HUD script by FL?
    I want to know how I can show the hours and/or the month,etc and maybe the number of pokebal and/or potions,etc
    (I can make a template for that Hud easily with Photoshop)
    I have zero knowledge in writting script (I'm ok to call script in event but nothing more :s)

    Thanks in advance!
    (sorry for my bad english)
     
    Last edited:

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    Change

    Code:
        text1=_INTL("text one")
        text2=_INTL("text two")
    to
    Code:
        text1= pbGetTimeNow.strftime("%I:%M %p")
        text2=_INTL("Poké Balls: {1}",$PokemonBag.pbQuantity(PBItems::POKEBALL))
     

    Qwertyis666

    Dragon Trainer Since 1996
    60
    Posts
    10
    Years
  • Thanks!!! my first demo is nearly finish with this ^^
    (Btw, if I want to add pokemon name under there icon do I need to get the script
    pbGetPokemon(1,2,3,etc) and pokemon.name??

    Thanks in advance
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    Change

    Code:
        for i in 0...$Trainer.party.size
          pokeicon=IconSprite.new(16+64*i,yposition-8,@viewport1)
          pokeicon.setBitmap(pbPokemonIconFile($Trainer.party[i]))
          pokeicon.src_rect=Rect.new(0,0,64,64)
          @hud.push(pokeicon)
        end

    to

    Code:
        pokemonNames = []
        bitmapOverlay = @hud[-1].bitmap
        for i in 0...$Trainer.party.size
          pokeicon=IconSprite.new(16+64*i,yposition-8,@viewport1)
          pokeicon.setBitmap(pbPokemonIconFile($Trainer.party[i]))
          pokeicon.src_rect=Rect.new(0,0,64,64)
          @hud.push(pokeicon)
          next if $Trainer.party[i].egg?
          x=64*i+48
          y=yposition+32
          pokemonNames.push([$Trainer.party[i].name,x,y,2,baseColor,shadowColor])
        end
        pbDrawTextPositions(bitmapOverlay,pokemonNames)

    You probably need to adjust the x/y positions.
     

    Qwertyis666

    Dragon Trainer Since 1996
    60
    Posts
    10
    Years
  • Change

    Code:
        for i in 0...$Trainer.party.size
          pokeicon=IconSprite.new(16+64*i,yposition-8,@viewport1)
          pokeicon.setBitmap(pbPokemonIconFile($Trainer.party[i]))
          pokeicon.src_rect=Rect.new(0,0,64,64)
          @hud.push(pokeicon)
        end
    to

    Code:
        pokemonNames = []
        bitmapOverlay = @hud[-1].bitmap
        for i in 0...$Trainer.party.size
          pokeicon=IconSprite.new(16+64*i,yposition-8,@viewport1)
          pokeicon.setBitmap(pbPokemonIconFile($Trainer.party[i]))
          pokeicon.src_rect=Rect.new(0,0,64,64)
          @hud.push(pokeicon)
          next if $Trainer.party[i].egg?
          x=64*i+48
          y=yposition+32
          pokemonNames.push([$Trainer.party[i].name,x,y,2,baseColor,shadowColor])
        end
        pbDrawTextPositions(bitmapOverlay,pokemonNames)
    You probably need to adjust the x/y positions.

    Thanks again! the positioning is a bit hard but the pokemon's name are too big, they are one over a other.
    This is a problem with my font or I can minimize them like the icon?
    (pokemonNames.zoom_x=0.5 and y=0.5 dont work)

    do you have any tips if it is not too much abuse on the topic?


    Thanks in advance
     
    1,224
    Posts
    10
    Years
  • Thanks again! the positioning is a bit hard but the pokemon's name are too big, they are one over a other.
    This is a problem with my font or I can minimize them like the icon?
    (pokemonNames.zoom_x=0.5 and y=0.5 dont work)

    do you have any tips if it is not too much abuse on the topic?


    Thanks in advance

    the zooms don't work because they aren't drawn the same way. Try setting the size of your font's smaller instead

    bitmapOverlay.font.size=18
     

    Qwertyis666

    Dragon Trainer Since 1996
    60
    Posts
    10
    Years
  • the zooms don't work because they aren't drawn the same way. Try setting the size of your font's smaller instead

    bitmapOverlay.font.size=18


    Thanks! Big thanks to you and FL to help me in this ^^ I'm working on the HUD Template and everything will be amazing!
     

    Qwertyis666

    Dragon Trainer Since 1996
    60
    Posts
    10
    Years
  • Hi, it's me again, I have a little other question about the HUD,
    I want to know if I can make the HUD rotate the info of the Pokemon.

    Like went I press a number on the keyboard ex: 1, The name is display,
    when I press 2, The Hp bar is display,
    when 3, the current exp is display.

    I know I will need to write something in the control stuff.....but in the Hud script I have no idea what to add/remove.

    Thanks in advance and sorry for the double post :s
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    At PokemonControls script section. Before line 'when Input::F5' add:

    Code:
    when Input::N1
      return [0x31,0x61] # 1 and numlock 1
    when Input::N2
      return [0x32,0x62] # 2 and numlock 2
    when Input::N3
      return [0x33,0x63] # 3 and numlock 3

    Before line 'F5 = 25' add:

    Code:
    N1    = 41
    N2    = 42
    N3    = 43

    Save your X and Y positions at your old HUD script. Replace it to:

    Code:
    $hud_index = 1 
    class Spriteset_Map
      # If you wish to use a background picture, put the image path below, like
      # BGPATH="Graphics/Pictures/battleMessage". I recommend a 512x64 picture
      BGPATH=""
      USEBAR=true # Make as 'false' to don't show the blue bar
      DRAWATBOTTOM=false # Make as 'true' to draw the HUD at bottom
      UPDATESPERSECONDS=0.15  # More updates = more lag. 
      
      alias :initializeOldFL :initialize
      alias :disposeOldFL :dispose
      alias :updateOldFL :update
      
      def initialize(map=nil)
        @hud = []
        initializeOldFL(map)
        # Updates every time when a map is loaded (including connections)
        $hud_need_refresh = true 
      end
        
      def dispose
        disposeOldFL
        disposeHud
      end
      
      def update
        updateOldFL
        updateHud
      end
      
      def createHud
        return if !$Trainer # Don't draw the hud if the player wasn't defined
        yposition = DRAWATBOTTOM ? Graphics.height-64 : 0
        @hud = []
        if USEBAR # Draw the blue bar
          bar=IconSprite.new(0,yposition,@viewport1)
          bar.bitmap=Bitmap.new(Graphics.width,64)
          bar.bitmap.fill_rect(Rect.new(0,0,bar.bitmap.width,bar.bitmap.height), 
              Color.new(128,128,192))  
          @hud.push(bar)
        end
        if BGPATH != "" # Draw the bar image
          bgbar=IconSprite.new(0,yposition,@viewport1)
          bgbar.setBitmap(BGPATH)
          @hud.push(bgbar)
        end
        # Draw the text
        baseColor=Color.new(72,72,72)
        shadowColor=Color.new(160,160,160)
        @hud.push(BitmapSprite.new(Graphics.width,Graphics.height,@viewport1))
        text1= pbGetTimeNow.strftime("%I:%M %p")
        text2=_INTL("Poké Balls: {1}",$PokemonBag.pbQuantity(PBItems::POKEBALL))
        textPosition=[
          [text1,Graphics.width-64,yposition,2,baseColor,shadowColor],
          [text2,Graphics.width-64,yposition+32,2,baseColor,shadowColor]
        ]
        pbSetSystemFont(@hud[-1].bitmap)
        pbDrawTextPositions(@hud[-1].bitmap,textPosition)
        # Draw the pokémon icons
        pokemonStrings = []
        bitmapOverlay = @hud[-1].bitmap
        for i in 0...$Trainer.party.size
          pokemon = $Trainer.party[i]
          pokeicon=IconSprite.new(16+64*i,yposition-16,@viewport1)
          pokeicon.setBitmap(pbPokemonIconFile(pokemon))
          pokeicon.src_rect=Rect.new(0,0,64,64)
          @hud.push(pokeicon)
          next if pokemon.egg?
          case $hud_index
            when 1
              x=64*i+48
              y=yposition+44
              pokemonStrings.push([pokemon.name,x,y,2,baseColor,shadowColor])
            when 2
              x=64*i+48
              y=yposition+52
              hpcolors=[
                Color.new(24,192,32),Color.new(0,144,0),    # Green
                Color.new(248,184,0),Color.new(184,112,0),  # Orange
                Color.new(240,80,32),Color.new(168,48,56)    # Red
              ]
              hpzone=0
              hpzone=1 if pokemon.hp<=(pokemon.totalhp/2).floor
              hpzone=2 if pokemon.hp<=(pokemon.totalhp/4).floor
              barSize=32
              bitmapOverlay.fill_rect(x-barSize/2-2,y-2,
                  barSize+4,10,Color.new(0,0,0))
              if pokemon.hp>0
                bitmapOverlay.fill_rect(x-barSize/2,y,
                    pokemon.hp*barSize/pokemon.totalhp,2,hpcolors[hpzone*2+1])
                bitmapOverlay.fill_rect(x-barSize/2,y+2,
                    pokemon.hp*barSize/pokemon.totalhp,4,hpcolors[hpzone*2])
              end  
            when 3
              x=64*i+48
              y=yposition+52
              startexp=PBExperience.pbGetStartExperience(
                  pokemon.level,pokemon.growthrate)
              endexp=PBExperience.pbGetStartExperience(
                  pokemon.level+1,pokemon.growthrate)
              barSize=32
              bitmapOverlay.fill_rect(x-barSize/2-2,y-2,
                  barSize+4,10,Color.new(0,0,0))
              if pokemon.level<PBExperience::MAXLEVEL
                bitmapOverlay.fill_rect(x-barSize/2,y,(pokemon.exp-startexp
                    )*barSize/(endexp-startexp),2,Color.new(72,120,160))
                bitmapOverlay.fill_rect(x-barSize/2,y+2,(pokemon.exp-startexp
                    )*barSize/(endexp-startexp),4,Color.new(24,144,248))
              end
          end    
        end
        bitmapOverlay.font.size=18
        pbDrawTextPositions(bitmapOverlay,pokemonStrings)
        # Adjust z of every @hud sprite
        for sprite in @hud
          sprite.z+=600 
        end
      end
      
      def updateHud
        for sprite in @hud
          sprite.update
        end
      end 
      
      def disposeHud
        for sprite in @hud
          sprite.dispose
        end
        @hud.clear
      end
    end
    
    class Scene_Map
      alias :updateOldFL :update
      alias :miniupdateOldFL :miniupdate
      alias :createSpritesetsOldFL :createSpritesets
      
      UPDATERATE = (Spriteset_Map::UPDATESPERSECONDS>0) ? 
          (Graphics.frame_rate/Spriteset_Map::UPDATESPERSECONDS).floor : 0x3FFF 
        
      def update
        updateOldFL
        if Input.trigger?(Input::N1)
          $hud_index = 1
          $hud_need_refresh = true
        end
        if Input.trigger?(Input::N2)
          $hud_index = 2
          $hud_need_refresh = true
        end
        if Input.trigger?(Input::N3)
          $hud_index = 3
          $hud_need_refresh = true
        end
        checkAndUpdateHud
      end
      
      def miniupdate
        miniupdateOldFL
        checkAndUpdateHud
      end
      
      def createSpritesets
        createSpritesetsOldFL
        checkAndUpdateHud
      end  
      
      def checkAndUpdateHud
        $hud_need_refresh = (Graphics.frame_count%UPDATERATE==0 ||
          $hud_need_refresh)
        if $hud_need_refresh
          for s in @spritesets.values
            s.disposeHud
            s.createHud
          end
          $hud_need_refresh = false
        end
      end
    end
    For copying the script at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
     
    Last edited:

    Qwertyis666

    Dragon Trainer Since 1996
    60
    Posts
    10
    Years
  • At PokemonControls script section. Before line 'when Input::F5' add:

    Code:
    when Input::N1
      return [0x31,0x61] # 1 and numlock 1
    when Input::N2
      return [0x32,0x62] # 2 and numlock 2
    when Input::N3
      return [0x33,0x63] # 3 and numlock 3
    Before line 'F5 = 25' add:

    Code:
    N1    = 41
    N2    = 42
    N3    = 43
    Save your X and Y positions at your old HUD script. Replace it to:

    Code:
    $hud_index = 1 
    class Spriteset_Map
      # If you wish to use a background picture, put the image path below, like
      # BGPATH="Graphics/Pictures/battleMessage". I recommend a 512x64 picture
      BGPATH=""
      USEBAR=true # Make as 'false' to don't show the blue bar
      DRAWATBOTTOM=false # Make as 'true' to draw the HUD at bottom
      UPDATESPERSECONDS=0.15  # More updates = more lag. 
      
      alias :initializeOldFL :initialize
      alias :disposeOldFL :dispose
      alias :updateOldFL :update
      
      def initialize(map=nil)
        @hud = []
        initializeOldFL(map)
        # Updates every time when a map is loaded (including connections)
        $hud_need_refresh = true 
      end
        
      def dispose
        disposeOldFL
        disposeHud
      end
      
      def update
        updateOldFL
        updateHud
      end
      
      def createHud
        return if !$Trainer # Don't draw the hud if the player wasn't defined
        yposition = DRAWATBOTTOM ? Graphics.height-64 : 0
        @hud = []
        if USEBAR # Draw the blue bar
          bar=IconSprite.new(0,yposition,@viewport1)
          bar.bitmap=Bitmap.new(Graphics.width,64)
          bar.bitmap.fill_rect(Rect.new(0,0,bar.bitmap.width,bar.bitmap.height), 
              Color.new(128,128,192))  
          @hud.push(bar)
        end
        if BGPATH != "" # Draw the bar image
          bgbar=IconSprite.new(0,yposition,@viewport1)
          bgbar.setBitmap(BGPATH)
          @hud.push(bgbar)
        end
        # Draw the text
        baseColor=Color.new(72,72,72)
        shadowColor=Color.new(160,160,160)
        @hud.push(BitmapSprite.new(Graphics.width,Graphics.height,@viewport1))
        text1= pbGetTimeNow.strftime("%I:%M %p")
        text2=_INTL("Poké Balls: {1}",$PokemonBag.pbQuantity(PBItems::POKEBALL))
        textPosition=[
          [text1,Graphics.width-64,yposition,2,baseColor,shadowColor],
          [text2,Graphics.width-64,yposition+32,2,baseColor,shadowColor]
        ]
        pbSetSystemFont(@hud[-1].bitmap)
        pbDrawTextPositions(@hud[-1].bitmap,textPosition)
        # Draw the pokémon icons
        pokemonStrings = []
        bitmapOverlay = @hud[-1].bitmap
        for i in 0...$Trainer.party.size
          pokemon = $Trainer.party[i]
          pokeicon=IconSprite.new(16+64*i,yposition-16,@viewport1)
          pokeicon.setBitmap(pbPokemonIconFile(pokemon))
          pokeicon.src_rect=Rect.new(0,0,64,64)
          @hud.push(pokeicon)
          next if pokemon.egg?
          case $hud_index
            when 1
              x=64*i+48
              y=yposition+44
              pokemonStrings.push([pokemon.name,x,y,2,baseColor,shadowColor])
            when 2
              x=64*i+48
              y=yposition+52
              hpcolors=[
                Color.new(24,192,32),Color.new(0,144,0),    # Green
                Color.new(248,184,0),Color.new(184,112,0),  # Orange
                Color.new(240,80,32),Color.new(168,48,56)    # Red
              ]
              hpzone=0
              hpzone=1 if pokemon.hp<=(pokemon.totalhp/2).floor
              hpzone=2 if pokemon.hp<=(pokemon.totalhp/4).floor
              barSize=32
              bitmapOverlay.fill_rect(x-barSize/2-2,y-2,
                  barSize+4,10,Color.new(0,0,0))
              if pokemon.hp>0
                bitmapOverlay.fill_rect(x-barSize/2,y,
                    pokemon.hp*barSize/pokemon.totalhp,2,hpcolors[hpzone*2+1])
                bitmapOverlay.fill_rect(x-barSize/2,y+2,
                    pokemon.hp*barSize/pokemon.totalhp,4,hpcolors[hpzone*2])
              end  
            when 3
              x=64*i+48
              y=yposition+52
              startexp=PBExperience.pbGetStartExperience(
                  pokemon.level,pokemon.growthrate)
              endexp=PBExperience.pbGetStartExperience(
                  pokemon.level+1,pokemon.growthrate)
              barSize=32
              bitmapOverlay.fill_rect(x-barSize/2-2,y-2,
                  barSize+4,10,Color.new(0,0,0))
              if pokemon.level<PBExperience::MAXLEVEL
                bitmapOverlay.fill_rect(x-barSize/2,y,(pokemon.exp-startexp
                    )*barSize/(endexp-startexp),2,Color.new(72,120,160))
                bitmapOverlay.fill_rect(x-barSize/2,y+2,(pokemon.exp-startexp
                    )*barSize/(endexp-startexp),4,Color.new(24,144,248))
              end
          end    
        end
        bitmapOverlay.font.size=18
        pbDrawTextPositions(bitmapOverlay,pokemonStrings)
        # Adjust z of every @hud sprite
        for sprite in @hud
          sprite.z+=600 
        end
      end
      
      def updateHud
        for sprite in @hud
          sprite.update
        end
      end 
      
      def disposeHud
        for sprite in @hud
          sprite.dispose
        end
        @hud.clear
      end
    end
    
    class Scene_Map
      alias :updateOldFL :update
      alias :miniupdateOldFL :miniupdate
      alias :createSpritesetsOldFL :createSpritesets
      
      UPDATERATE = (Spriteset_Map::UPDATESPERSECONDS>0) ? 
          (Graphics.frame_rate/Spriteset_Map::UPDATESPERSECONDS).floor : 0x3FFF 
        
      def update
        updateOldFL
        if Input.trigger?(Input::N1)
          $hud_index = 1
          $hud_need_refresh = true
        end
        if Input.trigger?(Input::N2)
          $hud_index = 2
          $hud_need_refresh = true
        end
        if Input.trigger?(Input::N3)
          $hud_index = 3
          $hud_need_refresh = true
        end
        checkAndUpdateHud
      end
      
      def miniupdate
        miniupdateOldFL
        checkAndUpdateHud
      end
      
      def createSpritesets
        createSpritesetsOldFL
        checkAndUpdateHud
      end  
      
      def checkAndUpdateHud
        $hud_need_refresh = (Graphics.frame_count%UPDATERATE==0 ||
          $hud_need_refresh)
        if $hud_need_refresh
          for s in @spritesets.values
            s.disposeHud
            s.createHud
          end
          $hud_need_refresh = false
        end
      end
    end
    For copying the script at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.


    Nice! Thanks again FL. Your scripts work perfectly !

    Here some ingame picture for anyone want to know what it look like

    jDOHlt9.png


    PdBRpyw.png


    tWacb5e.png
     
    119
    Posts
    10
    Years
  • i would like the hud to refresh everytime the party is changed or re sorted, where would i add this line?
    $hud_need_refresh = true
    thanks!
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    Nice screens! The pokémon are too small at Qwertyis666's screens. A tip: F8 takes screenshots (without the game title), saving the image at Saved Games folder.

    i would like the hud to refresh everytime the party is changed or re sorted, where would i add this line?
    $hud_need_refresh = true
    thanks!
    Quick mode: In PokemonPauseMenu (every time that you enter at "Pokémon" menu), after second 'if hiddenmove'. At PokemonStorage, after line 'screen.pbStartScreen(command)' (every time that you access box). In PokemonUtilies, after every line 'pbSeenForm(pokemon) if seeform' (when the player receives a pokémon). In PokemonEvolution, after line 'pbSeenForm(@pokemon)' (when a pokémon evolve). In PokemonEggHatching, after line 'screen.pbStartScreen(pokemon)'. In PokeBattle_Battle, after line '@scene.pbHideCaptureBall' (when a pokémon is caught).

    I don't remember more places now.
     
    119
    Posts
    10
    Years
  • Nice screens! The pokémon are too small at Qwertyis666's screens. A tip: F8 takes screenshots (without the game title), saving the image at Saved Games folder.

    Quick mode: In PokemonPauseMenu (every time that you enter at "Pokémon" menu), after second 'if hiddenmove'. At PokemonStorage, after line 'screen.pbStartScreen(command)' (every time that you access box). In PokemonUtilies, after every line 'pbSeenForm(pokemon) if seeform' (when the player receives a pokémon). In PokemonEvolution, after line 'pbSeenForm(@pokemon)' (when a pokémon evolve). In PokemonEggHatching, after line 'screen.pbStartScreen(pokemon)'. In PokeBattle_Battle, after line '@scene.pbHideCaptureBall' (when a pokémon is caught).

    I don't remember more places now.

    wow thats a lot of places haha, ill try that out later, thanks!
     
    13
    Posts
    9
    Years
    • Seen Nov 14, 2015
    At PokemonControls script section. Before line 'when Input::F5' add:

    Code:
    when Input::N1
      return [0x31,0x61] # 1 and numlock 1
    when Input::N2
      return [0x32,0x62] # 2 and numlock 2
    when Input::N3
      return [0x33,0x63] # 3 and numlock 3
    Before line 'F5 = 25' add:

    Code:
    N1    = 41
    N2    = 42
    N3    = 43
    Save your X and Y positions at your old HUD script. Replace it to:

    Code:
    $hud_index = 1 
    class Spriteset_Map
      # If you wish to use a background picture, put the image path below, like
      # BGPATH="Graphics/Pictures/battleMessage". I recommend a 512x64 picture
      BGPATH=""
      USEBAR=true # Make as 'false' to don't show the blue bar
      DRAWATBOTTOM=false # Make as 'true' to draw the HUD at bottom
      UPDATESPERSECONDS=0.15  # More updates = more lag. 
      
      alias :initializeOldFL :initialize
      alias :disposeOldFL :dispose
      alias :updateOldFL :update
      
      def initialize(map=nil)
        @hud = []
        initializeOldFL(map)
        # Updates every time when a map is loaded (including connections)
        $hud_need_refresh = true 
      end
        
      def dispose
        disposeOldFL
        disposeHud
      end
      
      def update
        updateOldFL
        updateHud
      end
      
      def createHud
        return if !$Trainer # Don't draw the hud if the player wasn't defined
        yposition = DRAWATBOTTOM ? Graphics.height-64 : 0
        @hud = []
        if USEBAR # Draw the blue bar
          bar=IconSprite.new(0,yposition,@viewport1)
          bar.bitmap=Bitmap.new(Graphics.width,64)
          bar.bitmap.fill_rect(Rect.new(0,0,bar.bitmap.width,bar.bitmap.height), 
              Color.new(128,128,192))  
          @hud.push(bar)
        end
        if BGPATH != "" # Draw the bar image
          bgbar=IconSprite.new(0,yposition,@viewport1)
          bgbar.setBitmap(BGPATH)
          @hud.push(bgbar)
        end
        # Draw the text
        baseColor=Color.new(72,72,72)
        shadowColor=Color.new(160,160,160)
        @hud.push(BitmapSprite.new(Graphics.width,Graphics.height,@viewport1))
        text1= pbGetTimeNow.strftime("%I:%M %p")
        text2=_INTL("Poké Balls: {1}",$PokemonBag.pbQuantity(PBItems::POKEBALL))
        textPosition=[
          [text1,Graphics.width-64,yposition,2,baseColor,shadowColor],
          [text2,Graphics.width-64,yposition+32,2,baseColor,shadowColor]
        ]
        pbSetSystemFont(@hud[-1].bitmap)
        pbDrawTextPositions(@hud[-1].bitmap,textPosition)
        # Draw the pokémon icons
        pokemonStrings = []
        bitmapOverlay = @hud[-1].bitmap
        for i in 0...$Trainer.party.size
          pokemon = $Trainer.party[i]
          pokeicon=IconSprite.new(16+64*i,yposition-16,@viewport1)
          pokeicon.setBitmap(pbPokemonIconFile(pokemon))
          pokeicon.src_rect=Rect.new(0,0,64,64)
          @hud.push(pokeicon)
          next if pokemon.egg?
          case $hud_index
            when 1
              x=64*i+48
              y=yposition+44
              pokemonStrings.push([pokemon.name,x,y,2,baseColor,shadowColor])
            when 2
              x=64*i+48
              y=yposition+52
              hpcolors=[
                Color.new(24,192,32),Color.new(0,144,0),    # Green
                Color.new(248,184,0),Color.new(184,112,0),  # Orange
                Color.new(240,80,32),Color.new(168,48,56)    # Red
              ]
              hpzone=0
              hpzone=1 if pokemon.hp<=(pokemon.totalhp/2).floor
              hpzone=2 if pokemon.hp<=(pokemon.totalhp/4).floor
              barSize=32
              bitmapOverlay.fill_rect(x-barSize/2-2,y-2,
                  barSize+4,10,Color.new(0,0,0))
              if pokemon.hp>0
                bitmapOverlay.fill_rect(x-barSize/2,y,
                    pokemon.hp*barSize/pokemon.totalhp,2,hpcolors[hpzone*2+1])
                bitmapOverlay.fill_rect(x-barSize/2,y+2,
                    pokemon.hp*barSize/pokemon.totalhp,4,hpcolors[hpzone*2])
              end  
            when 3
              x=64*i+48
              y=yposition+52
              startexp=PBExperience.pbGetStartExperience(
                  pokemon.level,pokemon.growthrate)
              endexp=PBExperience.pbGetStartExperience(
                  pokemon.level+1,pokemon.growthrate)
              barSize=32
              bitmapOverlay.fill_rect(x-barSize/2-2,y-2,
                  barSize+4,10,Color.new(0,0,0))
              if pokemon.level<PBExperience::MAXLEVEL
                bitmapOverlay.fill_rect(x-barSize/2,y,(pokemon.exp-startexp
                    )*barSize/(endexp-startexp),2,Color.new(72,120,160))
                bitmapOverlay.fill_rect(x-barSize/2,y+2,(pokemon.exp-startexp
                    )*barSize/(endexp-startexp),4,Color.new(24,144,248))
              end
          end    
        end
        bitmapOverlay.font.size=18
        pbDrawTextPositions(bitmapOverlay,pokemonStrings)
        # Adjust z of every @hud sprite
        for sprite in @hud
          sprite.z+=600 
        end
      end
      
      def updateHud
        for sprite in @hud
          sprite.update
        end
      end 
      
      def disposeHud
        for sprite in @hud
          sprite.dispose
        end
        @hud.clear
      end
    end
    
    class Scene_Map
      alias :updateOldFL :update
      alias :miniupdateOldFL :miniupdate
      alias :createSpritesetsOldFL :createSpritesets
      
      UPDATERATE = (Spriteset_Map::UPDATESPERSECONDS>0) ? 
          (Graphics.frame_rate/Spriteset_Map::UPDATESPERSECONDS).floor : 0x3FFF 
        
      def update
        updateOldFL
        if Input.trigger?(Input::N1)
          $hud_index = 1
          $hud_need_refresh = true
        end
        if Input.trigger?(Input::N2)
          $hud_index = 2
          $hud_need_refresh = true
        end
        if Input.trigger?(Input::N3)
          $hud_index = 3
          $hud_need_refresh = true
        end
        checkAndUpdateHud
      end
      
      def miniupdate
        miniupdateOldFL
        checkAndUpdateHud
      end
      
      def createSpritesets
        createSpritesetsOldFL
        checkAndUpdateHud
      end  
      
      def checkAndUpdateHud
        $hud_need_refresh = (Graphics.frame_count%UPDATERATE==0 ||
          $hud_need_refresh)
        if $hud_need_refresh
          for s in @spritesets.values
            s.disposeHud
            s.createHud
          end
          $hud_need_refresh = false
        end
      end
    end
    For copying the script at PokéCommunity: Click Thread Tools, and then Show Printable Version, and copy that instead.
    Can someone show me please, how to add a Button to toggle off/on the whole Bar? So like if you press "4".
     
    Back
    Top