Screen scroll, full scroll

Source: Internet
Author: User

Int lev_= 1;
Image map_image, map_back1, map_back11;
Image map_image1;
Int map_image_width, map_image_height;
Int map_back1_width, map_back1_height;
Int map_back11_width, map_back11_height;
Public void loading (INT le) throws exception {
// Le = 2;
// This. Level = Le;
// Level = 1;

Map_image = getimage ("/MAP/level" + le + ". PNG ");
Map_image1 = getimage ("/MAP/level" + le + ". PNG ");
Map_back1 = getimage ("/MAP/level" + le + ". PNG ");
Map_back11 = getimage ("/MAP/level" + le + ". PNG ");
System. Out. println ("Loading map ...");
Scrollleft = This. Width ()-map_image.getwidth ();
Drawx = 0; // getwidth ();
Drawy = height ();
System. GC ();
}

////////////////////////////////////

Void drawmap (){
Drawmap_back ();
Drawmap_back1 ();
Drawmap_back11 ();
// System. GC ();
}

Void drawmap_back (){
G. drawimage (map_image,-start_1, drawy, graphics. Bottom | graphics. Left );
G. drawimage (map_image,-start_1 + 176, drawy,
Graphics. Bottom | graphics. Left );
This. Scroll (1 );
// System. Out. println ("count +" + count );
}

Void drawmap_back1 (){
G. drawimage (map_back1,-start_2, drawy, graphics. Bottom | graphics. Left );
G. drawimage (map_back1,-start_2 + 176, drawy,
Graphics. Bottom | graphics. Left );
This. scroll2 (2 );
}

Void drawmap_back11 (){
Dx2 = drawx + map_back11.getwidth ();
G. drawimage (map_back11,-start_3, drawy,
Graphics. Bottom | graphics. Left );
G. drawimage (map_back11,-start_3 + 176, drawy,
Graphics. Bottom | graphics. Left );
This. scroll3 (10 );
}

Int start_1 = 0;
Int start_2 = 0;
Int start_3 = 0;
Int COUNT = 0;
Public int next = 0;
Protected int scroll (int SC ){
If (isleft ){
Start_1 + = SC;
If (start_1> = 176 ){
Start_1 = 0;
}
}
Next = count ++;
Return next;
}

Protected void scroll2 (int SC ){
If (isleft ){
Start_2 + = SC;
If (start_2> = 176 ){
Start_2-= 176;
}
}
}

Protected void scroll3 (int SC ){
If (isleft ){
Start_3 + = SC;
If (start_3> = 176 ){
Start_3-= 176;
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.