Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Blackthorne on Tue 14/02/2006 04:19:19

Title: Room Scrolling
Post by: Blackthorne on Tue 14/02/2006 04:19:19
Hello!

I have a room (640x200) that I'd like to have scroll in a unique way; basically, I want it to appear as two 320x200 rooms - it scroll OVER to the other half of the screen when EGO reaches a certain point (ie the x=319).  Is this possible?


Bt
Title: Re: Room Scrolling
Post by: Scummbuddy on Tue 14/02/2006 04:44:48
You'll have to use setviewport, and either releaseviewport or set it again when you need it, (such as) when they step on a walkable area
Title: Re: Room Scrolling
Post by: Blackthorne on Tue 14/02/2006 06:23:49
Thanks!  I shall try that, and report back.  I appreciate the help.


Bt
Title: Re: Room Scrolling
Post by: Blackthorne on Tue 14/02/2006 08:12:16
Okay - is there a way I can make it "PAN" over to the new room instead of just instantly changing?


Bt
Title: Re: Room Scrolling
Post by: Gilbert on Tue 14/02/2006 08:19:51
Yes.
For example:
//pan from left to right:
while (GetViewportX()<320)Ã,  {
Ã,  SetViewport(GetViewportX()+1, 0);
Ã,  Wait(1);
}


(and if you read the manual there's an similar example in SetViewport() :P)
Title: Re: Room Scrolling
Post by: Blackthorne on Tue 14/02/2006 18:33:48
Gilbot,

Thank you the help... and the advice.  Manuals... DUH!


Bt
Title: Re: Room Scrolling
Post by: Candle on Tue 14/02/2006 19:46:02
Look down this post for a module that was done.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=24343.0
You may like it .
Title: Re: Room Scrolling
Post by: Ashen on Tue 14/02/2006 20:11:06
Nice as it is to see that module being plugged (I must get around to releasing it properly...), I don't think it's quite what Blackthorne needs - it updates the Viewport X/Y based on the mouse, rather than character position. Might be able to get some ideas from it, though.
Title: Re: Room Scrolling
Post by: Blackthorne on Wed 15/02/2006 04:25:45
The plugin isn't quite what I need, you're right - but it's a damn fine plugin.  I'll definitely find a use for that in another game.

Again, thanks for all the input guys.


Bt