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

[Essentials Tutorial] Generation 5 Door Zoom Animation

971
Posts
7
Years
    • Age 21
    • Seen Nov 28, 2022
    You know how in generation 5, you had this zoom animation for doors?
    Gen_5_doors.gif


    And this replicates that:
    fJeouFM.gif



    To achieve this, you have to do the following:
    Put this code in a new section or somewhere else. Doesn't really matter.
    Code:
     def pbZoomIn
      $zoom.dispose if $zoom
      vp = Viewport.new(0,0,Graphics.width,Graphics.height)
      vp.z = 1000000
      $zoom = Sprite.new(vp)
      $zoom.bitmap = Graphics.snap_to_bitmap
      $zoom.x = $zoom.bitmap.width / 2
      $zoom.y = $zoom.bitmap.height / 2
      $zoom.ox = $zoom.bitmap.width / 2
      $zoom.oy = $zoom.bitmap.height / 2
    end
     
    def pbUpdateZoom(time)
      time.times do
    	Graphics.update
    	Input.update
    	$zoom.zoom_x += 0.01
    	$zoom.zoom_y += 0.01
      end
    end
     
    def pbFadeOutZoom
      32.times do
    	Graphics.update
    	Input.update
    	$zoom.zoom_x += 0.01
    	$zoom.zoom_y += 0.01
    	$zoom.opacity -= 255 / 32.0
      end
      $zoom.dispose
    end


    Now, for your door event, this is what it should look like:
    cEacKQ9.png

    You can change the number "48" to change how long the zooming takes (and thus how far it zooms in)


    Credits
    • Marin
     
    Last edited:
    Back
    Top