Zoom script help

Hi,
Using the following XP script: viewtopic.php?f=11&t=67068&p=668741&hilit=zoom#p668741

I'm making a cutscene. In short, because of how I'm animating it, Midgar is a 640x480 characterset.

I want to "zoom in" on midgar, slowly, as the end of the cutscene.

  1.  
  2. # my attempts, didn't seem to do anything
  3. class Interpreter
  4.   def zoom_in_on_midgar
  5.     x = 1.0
  6.     y = 1.0
  7.     for i in 0...100
  8.       x += 0.1
  9.       y += 0.1
  10.       $game_player.zoom(x, y)
  11.     end
  12.   end
  13. end
  14.  
Expand to see the code.


It's been a long while since I've used RMXP or RGSS, so I'm a bit rusty. Anyone got any ideas on how this could work?

The idea was it would slowly zoom in during the for loop.
All right. Instead of using a for loop, you'll want to add a counter and an if/else statement to the pertinent update method. The for loop you have will go from 0 to 99 before it ever manages to update the graphics. Instead, you want to initialize a counter as 0 when the class is called, and set it to 100 using this method. Then, in the update method, you'll check to see if it is above 0. If it is, you will perform the same code you had in the loop, and decrement the counter. This way it can actually update the graphics, as well. Also, the game runs at either 40 or 60 FPS (depending on whether it's XP or VX), so this won't exactly be a slow zoom of the camera.
Thanks, I think I understand it now.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=71236