[TUT]Scrolling Pictures

Started by Calintz, October 27, 2009, 12:50:37 pm

Previous topic - Next topic

Calintz

October 27, 2009, 12:50:37 pm Last Edit: October 27, 2009, 12:52:15 pm by Calintz
Because a picture can be any size, you may be left thinking that the only way to scroll a picture efficiently is by guess, test, and revising until you get something that works for you. However, if you pre-define your dimensions to be relative to RMXP (a multiple of 32), then you can easily save yourself valuable time and effort by working around a bunch of trial and error by making a few calculations before hand.

QuoteBlizzard says that to scroll a map:
The waiting time is the same as waiting time for moving characters depending on their moving speed.

   * speed 1 = 32 frames per map square
   * speed 2 = 16 frames per map square
   * speed 3 = 8 frames per map square
   * speed 4 = 4 frames per map square
   * speed 5 = 2 frames per map square
   * speed 6 = 1 frame per map square


Also, these are EVENT frames. Script frames are doubled.


I have personally confirmed these speeds to be accurate. They can be used as a base for scrolling pictures just as scrolling the map ...
I would personally suggest using a speed of two or three for a scrolling prologue picture, but that's just me. At any rate, this is how you would set things up ...

** If you wanna get a feel for how fast each speed is, then play with them shortly in a project ...

As Starrod mentioned earlier, make your photo larger than 480 in height ...
(I recommend keeping the photo's dimensions relative to RPGXP in the sense that it is divisible by 32. This will make things run very smooth)

So let's say you have a prologue with twice the height of regular dimensions (640px - 960px) and you have been playing around with the scroll map command, and you have grown to like the speed of 2. Have no fear, you too can easily scroll a picture at the same speed by calculating the following:

   * How many pixels your picture needs to move
   * How many map squares your picture needs to move
   * How long should we wait

How many pixels does your picture need to move??
This is perhaps the easiest calculation to determine. To get the number of pixels that your picture will need to move, simply subtract the standard height limits (480px) from your picture's max height (960px). That's it. Now we know that we will need to move our picture 480px.
960 - 480 = 480.

How many map squares does your picture need to move??
So, now that we know exactly how far we will need to move our picture, it's time to calculate how many map squares it will be moving. We know that each map square is 32px - 32px, so in order to calculate the amount of map squares that your picture will be moving, simply divide the total amount of pixels that your picture will be moving (480px) by map square height (32px)
480 / 32 = 15.

** please note that if you keep your picture's dimensions relative to 32px, you will ALWAYS have an even number here.

How long should we wait for our picture to scroll??
Now that we know how many map squares that our picture will be moving, it's time to make our final calculation (How long to set our wait command). Seeing as we will be moving 15map squares, the final calculation is done by multiplying the number of map squares we will be moving (15sq) by the pre-defined speeds above. (Thanks Blizzard!!)

So if you would like to use a speed of one (slowest) ...
15 * 32 = 480

If that seems to slow (which it will) try using two or three ...
15 * 16 = 240
15 * 8 = 120

Finally, punch your stuff into the system
Spoiler: ShowHide


Thank you for reading ...
I hope that this will help you.

-Calintz-

Aqua