The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Essentials Tutorial Generation 5 Door Zoom Animation

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old October 18th, 2017 (5:31 AM). Edited October 18th, 2017 by Marin.
Marin's Avatar
Marin Marin is offline
Not Bored
     
    Join Date: Nov 2016
    Gender: Other
    Posts: 624
    You know how in generation 5, you had this zoom animation for doors?


    And this replicates that:



    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:

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


    Credits
    • Marin
    __________________
    If you're looking for me, I'm on Safari Zone.
    Reply With Quote

    Relevant Advertising!

    Reply

    Quick Reply

    Join the conversation!

    Create an account to post a reply in this thread, participate in other discussions, and more!

    Create a PokéCommunity Account

    Sponsored Links
    Thread Tools

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -8. The time now is 5:26 AM.