• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

[Scripting Question] Change text position in battle factory

  • 5
    Posts
    2
    Years
    • Seen Sep 3, 2022
    So currently I'm trying to re-position the rental Pokemon text, as it is about 5-10 pixels too high and gets cut off. I believe the correct script is
    Code:
    UI_BattleSwap
    and I understand the following:

    Code:
    def pbStartRentScene(rentals)
        @rentals = rentals
        @mode = 0   # rental (pick 3 out of 6 initial Pokémon)
        @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
        @viewport.z = 99999
        @sprites = {}
        addBackgroundPlane(@sprites, "bg", "rentbg", @viewport)
        @sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
          _INTL("RENTAL POKéMON"), 0, 0, Graphics.width, 64, @viewport
        )
        @sprites["list"] = Window_AdvancedCommandPokemonEx.newWithSize(
          [], 0, 64, Graphics.width, Graphics.height - 128, @viewport
        )
        @sprites["help"] = Window_UnformattedTextPokemon.newWithSize(
          "", 0, Graphics.height - 64, Graphics.width, 64, @viewport
        )
        @sprites["msgwindow"] = Window_AdvancedTextPokemon.newWithSize(
          "", 0, Graphics.height - 64, Graphics.height, 64, @viewport
        )
        @sprites["msgwindow"].visible = false
        pbUpdateChoices([])
        pbDeactivateWindows(@sprites)
        pbFadeInAndShow(@sprites) { pbUpdate }
    end

    this sets the text window sprites


    Code:
      def pbGetCommands(list, choices)
        commands = []
        list.length.times do |i|
          pkmn = list[i]
          category = pkmn.species_data.category
          cmd = _INTL("{1} - {2} Pokémon", pkmn.speciesName, category)
          cmd = "<c3=E82010,F8A8B8>" + cmd if choices.include?(i)   # Red text
          commands.push(cmd)
        end
        return commands
    end

    and this sets the rental pokemon. I tried setting the y-positions on the @sprites but it moves an entire window sprite. How would I do just the text?
     
    @sprites["list"].oy = -15 does move the text but also moves the selector arrow and has this dragging effect of the top layer.
    @sprites["list"].update does nothing.

    [PokeCommunity.com] Change text position in battle factory
     
    Last edited:
    In SpriteWindow_text I changed the @virtual0y in line 807 from -2 to 0 and in line 739 from -2 to 0. Still working on moving the cursor up without the text.
     
    Back
    Top