Pan a camera over BG?

Started by Gfunkera, Thu 01/04/2004 10:23:23

Previous topic - Next topic

Gfunkera

Ok, so I wasnt sure were to put this so this seemed like a good place.... Ok so what I want to do is I got a bg I've made of a volcanoe island and I want to gradually zoom in on the bg, untill the volcanoe is close up.... Now is there a easy way of doing this, software, script, etc. ??? Or what would you guys say would be the easiest way of doing this? Your replies will be greatley appreciated.

Gilbert

If you meaned doing this in AGS, it's actually better put  in the beginners' tech forum.

That depends on how you want the effects to be, there're lots of ways, eg.
1. Play a FLIC
2. Play an AVI
3. Use animated bg frames
4. Put the graphics of teh volcano as a character, and use walkable areas to scale it up
5. Try those Raw Draw scaled functions in the new beta.

quintaros (at school)

I don't believe there is any existing function for zooming  in on a background.  I've experimented with making the background as a character on a scaled walkable area and have it walk toward the front of the room to simulate a zoom.  As I recall it was complicated by how the base of the background was defined so that it got larger on screen without appearing to shift position.

m0ds

Rich, you'll have to create a video file.

Either that, or ask the Escape From Delirium team how to do it.

;)

SSH

#4
If you use 2.61 beta 3 or later then you can do something like this

function room_a() {
  // script for room: Player enters screen (after fadein)
int i=0;
WaitMouseKey(40);
while (i<800) {
  RawDrawImageResized(-i, -((i*5)/8), 1, 320+(i*2), 200+((i*5)/4));
  i=((i*100)/99)+1;
  Wait(1);
}
WaitMouseKey(500);
QuitGame(0);
  
}

function room_b() {
  // script for room: Player enters screen (before fadein)
RawDrawImageResized(0, 0, 1, 320, 200);
  
}




The complicated arithmetic is just there to stop the zoom slowing down as you get closer (which is what happens if you have i=i+1).

If you want to zoom as if the camera was moving over water to your island, then  of course, the horizon will change relative to the island which will take a lot more effort...
12

Gfunkera

#5
Yea, thanks I think that is just what I needed :-)

- EDIT -

Where can I find 2.61 beta 3?

- EDIT -
Nevermind I found beta 4 here.

Ok I get a error when trying to save room??
I've copied everything exactley... I think  :-\

Gfunkera

Ok so do I copy this code directley into the room I want too zoom?? So i imported my image of the ocean and volcanoe, now I click "i" button for room interactions and click script and add the script above?? I notice the room tags like room_a & room_b whats this for??? Please help me aaaaaaaaahhhhhhhhhhhhhhhhhh lol :p

SSH

*cough* RTFm *cough*

anyway..

You'll need to change the "1" sprite number:

 RawDrawImageResized(-i, -((i*5)/8), YOUR_SPRITE_NUMBER_HERE, 320+(i*2), 200+((i*5)/4));

same goes for the other call of that function, change the 1 to your sprite number.

You need to open the interaction editor, chnage Before Faedin interaction to run script, edit script and paste the
 // script for room: Player enters screen (before fadein)
RawDrawImageResized(0, 0, YOUR_SPITE_NO_HERE, 320, 200);

code into the editor. Save and close that, then add a run script interaction for "After faedin" and copy the other code in there.

12

Gfunkera

Ok so I would use my volcanoe background as a sprite?? Well anyways I guess I better read the manual although I don't think I'm realy understanding this correctley....

Gfunkera

Well anyways still getting error compiling script after defining sprites....  


Error (line 11): Undefined token 'WaitMouseKey'  could I just get the crm files from you that used to do this???

SSH

I only put the waitmousekey in there for the demo: you'll probably want to do different things yourself before and after the zoom. If you're getting that error, I guess you may have missed some punctuation out somewhere, such as a ";" at the end of a line.

Seriously, though, if you're going to try and do something at all complicated like this, try following the help file's scripting tutorial first.
12

Gfunkera

Well after screwing with it for an hour I got it working real nice  8)

SMF spam blocked by CleanTalk