Ok i made a testquest showing the problem i have with draw screen. First of all this is the script i use:
CODE
bool new_screen_is_to_the_left(int new_screen, int old_screen){//check which direction Link walked in
if(new_screen-old_screen==-1) return true;
else return false;
}
bool new_screen_is_to_the_right(int new_screen, int old_screen){
if(new_screen-old_screen==1) return true;
else return false;
}
bool new_screen_is_up(int new_screen, int old_screen){
if(new_screen-old_screen==-16) return true;
else return false;
}
bool new_screen_is_down(int new_screen, int old_screen){
if(new_screen-old_screen==16) return true;
else return false;
}
void Smoothscrolling(int old_screen, int new_screen, int old_map, int new_map){ //the scrolling function
itself
if(old_map==new_map){
if(new_screen_is_to_the_left(new_screen,old_screen)){
for(int i=0;i<60;i++){
NoAction();
Screen->Rectangle(0, 0, 0, 512, 512, 0, 1.0, 0, 0, 0, true, 128);
Screen->DrawScreen(0, Game->GetCurMap()-1, Game->GetCurScreen(), -256+4*i, 55,
0); //this should draw both screen 0 and 1
Screen->DrawScreen(0, Game->GetCurMap()-1, Game->GetCurScreen()+1, 4*i, 55,
0);
Waitframe();
}
}
}
}
global script onstart { //the main scrolling script
void run() {
int old_screen=-10;
int new_screen=1;
int old_map=-2;
int new_map=-1;
while(true) {
new_screen=Game->GetCurScreen();
new_map=Game->GetCurMap();
if(old_screen!=new_screen){
Smoothscrolling(old_screen, new_screen, old_map,new_map);
old_screen=new_screen;
old_map=new_map;
}
Waitframe();
}
}
}
The testquest i made with this can be found here:
http://www.mediafire...gj429gyugpwpva7My problem is DrawScreen only draws Layer0 all other layers seem to get cut.(yes there is a bug in the demo because i draw on layer 0 and so you see some residue from upper layers while scrolling but thats not the problem) Why doesnt DrawScreen draw all other layers like it is supposed to?