Dear Chaos Project members,
I was hoping that somebody would be so kind as to create an in-depth tutorial on how to show images in a window using the script editor, and how to pan those images as well. These features are often seen in animated title screens, menus, etc...
Thank you in advance ...
I don't know much about how to do this, myself. But I'd take a look at the game intro script Blizz wrote for the BlizzABS demo. It creates and moves images all over the place.
That's just the thing ...
I know of several scripts that utilize this feature that I could look into and try to put two and two together, but I grasp things quicker if I'm not running all over the place wondering if this code here is part of the process, or that code there, you know??
If I'm told exactly what does what in pure layman's terms, then I can adapt very well and begin to memorize the code very easily. I found this out by reading through one of Mr. Mo's window tutorials. By extensively reviewing and forcing the information into my head, I can create windows, show pictures, and animate them from scratch.
However, I don't know how to pan, because that was not part of the tutorial. Therefore, I didn't learn it ...
to draw a picture: use Bitmap.blt
to move a picture: erase where the image is and draw it somewhere else.
To get the code for all of this: go into RMXP, hit F1, search for Bitmap, and hit the first item that appears.
But how would that pan the picture constantly. I want it to pan indefinitely, not just relocate ...
There are many ways... they all include loops.
PSEUDO-CODE :D
loop do
unless x > 150
Bitmap.blt(x, y, w, h, Rect)
x += 5
else
break
This would move the picture 5 pixels to the right every frame.
Unless I'm really off with my coding... O.o
while x < 150
Bitmap.clear
Bitmap.blt(x, y, w, h, Rect)
x += 5
end
needed the .clear
and don't use do when you can use while.
This may be stupid, but what's the distinct difference between do and while??
do-while loops will execute the loop at least once since the first checking of the condition is at the end. while loops can end up not being executed at all since the condition is checked right at the beginning and naturally it won't execute even one iteration if the condition isn't fulfilled.
It's not stupid. It's, in fact, a question that is asked often.
Oh, so these two differ by affecting efficiency??
Not really. As I said, they just differ in their concepts a bit. If you need the code in a loop to be executed at least once, you use do-while, otherwise you use while.
right, which is why if you only need while, don't use a do-while.
Okay ...
I think I understand.
I will see what I can come with using these methods.