• 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.

How do I draw Pokémon icons in FL's Simple Hud?

Aljen

The Lost Boy...
  • 125
    Posts
    11
    Years
    Hi guys,
    So i was wonder if you could draw the icon of each pokemon to the place you want like at each corner of the screen there is a Pokemon icon.
    I mean I want to make each icon sprite have their own X, Y positions, not
    Code:
    pokeicon=IconSprite.new(5+64*i,yposition-3,@viewport1
    ) ^^ since I want to make a better HUD for my game.
    Thank you and thanks FL for this great script ~^^~
     
    Code:
    if i==0
      pokeicon=IconSprite.new([COLOR="red"]firstpokemonX[/COLOR],[COLOR="Red"]firstpokemonY[/COLOR],@viewport1)
    elsif i==1
      pokeicon=IconSprite.new([COLOR="red"]secondpokemonX[/COLOR],[COLOR="Red"]secondpokemonY[/COLOR],@viewport1)
    elsif i==2
      pokeicon=IconSprite.new([COLOR="red"]thirdpokemonX[/COLOR],[COLOR="Red"]thirdpokemonY[/COLOR],@viewport1)
    elsif i==3
      pokeicon=IconSprite.new([COLOR="red"]fourthpokemonX[/COLOR],[COLOR="Red"]fourthpokemonY[/COLOR],@viewport1)
    elsif i==4
      pokeicon=IconSprite.new([COLOR="red"]fifthpokemonX[/COLOR],[COLOR="Red"]fifthpokemonY[/COLOR],@viewport1)
    elsif i==5
      pokeicon=IconSprite.new([COLOR="red"]sixthpokemonX[/COLOR],[COLOR="Red"]sixthpokemonY[/COLOR],@viewport1)
    end

    Replace the line of code you showed us with this chunk of code, then replace the red portions with your desired coordinates.
     
    It really worked ^^
    Last question, Do you know how to change the font size of the text in FL hud? ^^
    Thanks
     
    Last edited:
    After line 'pbSetSystemFont(@hud[-1].bitmap)' add '@hud[-1].bitmap.font.size=24'. Untested.

    Man, this script is so old. Maybe someday I make a lag-free version.
     
    After line 'pbSetSystemFont(@hud[-1].bitmap)' add '@hud[-1].bitmap.font.size=24'. Untested.

    Man, this script is so old. Maybe someday I make a lag-free version.

    Its old but its still good xD, thank you FL, here is my HUD ^^ it will be much better when i find a way to attach it to the MEnu when pressing Z or Esc ^^ i want to show it with the menu
    [PokeCommunity.com] How do I draw Pokémon icons in FL's Simple Hud?
     
    • Like
    Reactions: FL
    That looks gorgeous.

    I also ended up adapting FL's script to only display during the pause menu, but I'm using the conventional appearance as he programmed it, plus a few additional lines of code to display icons depending on what items the Pokemon in your party are holding. There's probably an easier way of doing it, but I especially made a global switch that says "yes the game is paused" - manually turning it on at the start of the pause function and off at the end - then made the HUD depend on that switch. I had to be sure to turn that switch off when loading a save, though.
     
    Thank you, it would be perfect if it show and dispose with the menu ^^ , the problem is when i assign it to menu button when menu shows it also shows, but when menu close it still there, open the menu again it will dispose xD
     
    Thank you, it would be perfect if it show and dispose with the menu ^^ , the problem is when i assign it to menu button when menu shows it also shows, but when menu close it still there, open the menu again it will dispose xD

    Don't assign it to thee pause button directly. Here's how I did it:

    In the HUD scripts, near the bottom, add these lines:
    Code:
    def checkAndUpdateHud
        [COLOR="Red"]if $game_switches[PAUSED][/COLOR]
          $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
        [COLOR="red"]else
          for s in @spritesets.values
            s.disposeHud
          end
        end[/COLOR]
      end

    Then, in PScreen_PauseMenu, add this line of code directly below "def pbStartPokemonMenu":
    Code:
    $game_switches[PAUSED]=true
    $hud_need_refresh = true
    and this one above "@scene.pbEndScene if endscene", which is at the bottom of the scripts:
    Code:
    $game_switches[PAUSED]=false
    $hud_need_refresh = true

    In PScreen_Load, below "$scene = Scene_Map.new", add this:
    Code:
    $game_switches[PAUSED]=false
    (because saving the game saves all the game switches, including the one I used to tell the game the game was paused. This means that switch is on when you load a save file, meaning that the HUD will appear even though you're not paused when you start a saved file.)

    Then all you need to do is define the number PAUSED. In my game it's 63, but you may already be using switch #63.
     
    Back
    Top