• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Using the Zoom Function on Back Sprites

Worldslayer608

ಥдಥ
  • 857
    Posts
    17
    Years
    Using the Zoom Function on Back Sprites [ANSWERED]

    So I am trying to use the zoom function to double the size of my back sprites in battle. But I am not having any luck getting them to zoom. Here is what I am adding:

    Code:
            [COLOR="Green"]#ADDED[/COLOR]
            @sprites["pokemon0"].zoom_x=2
            [COLOR="Green"]#ADDED[/COLOR]
            @sprites["pokemon0"].zoom_y=2

    I have added the code to the following section in PokeBattle_ActualScene thinking it was correct, and it did not manage to do anything at all:

    Code:
        @sprites[[COLOR="Purple"]"pokemon0"[/COLOR]]=PokemonBattlerSprite.new(battle.doublebattle,[COLOR="DarkRed"]0[/COLOR],@viewport)
        @sprites[[COLOR="purple"]"pokemon0"[/COLOR]].z=[COLOR="DarkRed"]21[/COLOR]
            [COLOR="green"]#ADDED[/COLOR]
            @sprites[[COLOR="purple"]"pokemon0"[/COLOR]].zoom_x=[COLOR="DarkRed"]2[/COLOR]
            [COLOR="Green"]#ADDED[/COLOR]
            @sprites[[COLOR="purple"]"pokemon0"[/COLOR]].zoom_y=[COLOR="DarkRed"]2[/COLOR]

    After that did not work, I removed it from the above section and then put it in this section of PokeBattle_ActualScene:

    Code:
        @sprites[[COLOR="Purple"]"pokemon#{battlerindex}"[/COLOR]].setPokemonBitmap(pkmn,[COLOR="Blue"]true[/COLOR])
        sendout=PokeballPlayerSendOutAnimation.new(@sprites["[COLOR="purple"]pokemon#{battlerindex}"[/COLOR]],
           @sprites,@battle.battlers[battlerindex],@battle.doublebattle)
           @playerpokemon=@sprites[[COLOR="purple"]"pokemon0"[/COLOR]]
            [COLOR="Green"]#ADDED[/COLOR]
            @sprites[[COLOR="Purple"]"pokemon0"[/COLOR]].zoom_x=[COLOR="DarkRed"]2[/COLOR]
            [COLOR="green"]#ADDED[/COLOR]
            @sprites[[COLOR="purple"]"pokemon0"[/COLOR]].zoom_y=[COLOR="DarkRed"]2[/COLOR]
           @playerpokemon2=@sprites[[COLOR="purple"]"pokemon2"[/COLOR]]

    This still did not work, so I tried adding it to both and got nothing once again.

    So I am wondering what I am missing for this to work. Anyone able to help me out?

    EDIT

    So for those wondering the solution to this you can adjust this section under class PokeballPlayerSendOutAnimation in PokeBattle_ActualScene:

    Code:
        [COLOR="blue"]if[/COLOR] @frame>[COLOR="DarkRed"]5[/COLOR] && @PokemonBattlerSprite.zoom_x<[COLOR="DarkRed"]2.0[/COLOR]
          @PokemonBattlerSprite.zoom_x+=[COLOR="DarkRed"]0.2[/COLOR]
          @PokemonBattlerSprite.zoom_y+=[COLOR="DarkRed"]0.2[/COLOR]
          @PokemonBattlerSprite.zoom_x=[COLOR="DarkRed"]2.0[/COLOR] [COLOR="Blue"]if[/COLOR] @PokemonBattlerSprite.zoom_x > [COLOR="DarkRed"]2.0[/COLOR]
          @PokemonBattlerSprite.zoom_y=[COLOR="DarkRed"]2.0[/COLOR] [COLOR="blue"]if[/COLOR] @PokemonBattlerSprite.zoom_y > [COLOR="DarkRed"]2.0[/COLOR]
          pbSpriteSetCenter(@PokemonBattlerSprite,@spritex,[COLOR="DarkRed"]0[/COLOR])
          @PokemonBattlerSprite.y=@spritey+(@endspritey-@spritey)*@PokemonBattlerSprite.zoom_y
        [COLOR="Blue"]end[/COLOR]
        [COLOR="blue"]if[/COLOR] @PokemonBattlerSprite.tone.gray<=0 && @PokemonBattlerSprite.zoom_x>=[COLOR="DarkRed"]2.0[/COLOR]

    Resolved thanks to Venom12, I have added the solution to the original post.
     
    Last edited:
    After doing this are you having any issues with the text size with the battle messages? I remember doing something similar at one point when I was experimenting with different sprites and the text size getting all messed up.

    No issues at all that I have noticed :D
     
    Back
    Top