intro scroll

Started by AlphaMole, Fri 03/10/2003 08:23:16

Previous topic - Next topic

AlphaMole

hey, im making a short demo for my game and I was wondering if there was a way to scroll a background up while displaying text on the screen
"this is the worst thing I have ever tasted" *munch*
"then why are you still eating it?!"
..."It's in my hand"

TeeKay

What kind of text do you mean? If you use Overlays, then the scrolling should be possible with some while loop, and if the bg should scroll for a longer time, the looing room script might help. I'm not on my own machine, so I have no example to consult... but since the screen follows the player character, you can do:

in room - player enters screen (after fadein):

int scroll, disp, overl;

while (scroll < 640) { //say, you have a rom 700 wide, which shold scroll from end to end once
scroll ++ ;
character[EGO].x = scroll;
// Place the display command conditional's here,
like:
if (scroll == 100) disp = 1;
else if (scroll == 130) disp = 2;
else if (scroll == 170) disp = 3;
if (disp == 1) overl = CreateTextOverlay(20,90,180,1,14,"Text here, yellow");
else if (disp == 2) SetTextOverlay(overl,20,90,180,1,9,"Other text here, light blue");
else if (disp == 3) SetTextOverlay(overl,20,90,180,1,7,"Yet another text, light gray");
}

Using this, every time you enter the room the sequence is repeated. You should probably hide the player character...

TeeKay

And forgot... add Wait(1); to the end of the script, before the }

AlphaMole

ok, so "character[EGO].x = scroll;" is what actually does the scrolling, am I right?
and I can change that to .y for a virtical scroll?

why is there two sets of if-else statments, or am I missing something?
"this is the worst thing I have ever tasted" *munch*
"then why are you still eating it?!"
..."It's in my hand"

AlphaMole

#4
hmm.. I see the reason now for two if-else. but It's not running for some reason "too many displays" now that's not right...


EDIT:: took out one if-else statment block, it was exicuting the create text about 30 times before changing
"this is the worst thing I have ever tasted" *munch*
"then why are you still eating it?!"
..."It's in my hand"

Arcangel

You can also prove this that you that it works.But before: Is your game hi-color? because in another way this doesn't work  
 
 
/ / room script file  
 
function room_a () {  
 / / script for room: Player enters screen (before fadein)  
HideMouseCursor ();  
SetCharacterTransparency(HICOLOR,100);  / / character or something created in Hi_color for transparency
MoveCharacter(HICOLOR,1223,113); / / will move toward the right  my scroll to right i set it 160,113
SetTimer(2,120); / / several timer to know when to change the texts  
SetTimer(3,240);  
SetTimer(4,360);  
SetTimer(5,480);  
}  
 
function room_b () {  
 / / script for room: Repeatedly execute  
/ / A single GUI and change the text in a graphic way  
if (GetGlobalInt(1)==1){SetGUIPosition(0,50,210);SetButtonPic(0,0,1,41);SetGlobalInt(1,2);} / / The first one this position from the beginning  
if (IsTimerExpired(2)==1){SetGUIPosition(0,90,210);SetButtonPic(0,0,1,42);}  
if (IsTimerExpired(3)==1){SetGUIPosition(0,70,210);SetButtonPic(0,0,1,43);}  
if (IsTimerExpired(4)==1){SetGUIPosition(0,100,210);SetButtonPic(0,0,1,44);}  
if (IsTimerExpired(5)==1){GUIOff(0);}  
}

SMF spam blocked by CleanTalk