ZoriaRPG

Generic ScrollingStrings Template FFC

Mar 16th, 2018
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const int OUTPUT_LAYER = 6;
  2. const int STRING_X = 12;
  3. const int STRING_FONT = 0;
  4. const int STRING_COLOUR = 0x01;
  5. const int COLOUR_BLACK = 0x0F;
  6. const int INTRO_MIDI = 1;
  7.  
  8. ffc script ScrollingStrings
  9. {
  10.      void run()
  11.      {
  12.           Game->PlayMIDI(INTRO_MIDI);  
  13.           int q;
  14.           int introDur =100;
  15.           int outroDur = 100;
  16.           int fontHeight = 8;
  17.           int lineSpacing = 2;
  18.           int numLines = 24;
  19.           int line_with_spacing = lineSpacing+fontHeight;
  20.           int screenHeight = 200;
  21.           int totalHeight = numLines * line_with_spacing + screenHeight;
  22.           int tempOffset = screenHeight;
  23.           int scrollMinY = totalHeight * -1;
  24.           int drawpos = 0;
  25.           bool drawing = true;
  26.  
  27.           int line01[]="String line 1.";
  28.           int line02[]="String line 2.";
  29.           int line03[]="String line 3.";
  30.           int line04[]="String line 4.";
  31.           int line05[]="String line 5.";
  32.           int line06[]="String line 6.";
  33.           int line07[]="String line 7.";
  34.           int line08[]="String line 8.";
  35.           int line09[]="String line 9.";
  36.           int line10[]="String line 10.";
  37.           int line11[]="String line 11.";
  38.           int line12[]="String line 12.";
  39.           int line13[]="String line 13.";
  40.           int line14[]="String line 14.";
  41.           int line15[]="String line 15.";
  42.           int line16[]="String line 16.";
  43.           int line17[]="String line 17.";
  44.           int line18[]="String line 18.";
  45.           int line19[]="String line 19.";
  46.           int line20[]="String line 20.";
  47.           int line21[]="String line 21.";
  48.           int line22[]="String line 22.";
  49.           int line23[]="String line 23.";
  50.           int line24[]="String line 24.";
  51.           int strings[]={
  52.                line01, line02, line03, line04, line05, line06,
  53.                line07, line08, line09, line10, line11, line12,
  54.                line13, line14, line15, line16, line 17, line18,
  55.                line19, line20, line21, line22, line23, line24
  56.           };
  57.           //Intro black screen
  58.           for ( q = 0; q < introDur; ++q )
  59.           {
  60.                Screen->Rectangle(OUTPUT_LAYER, 0,0,256,176, COLOUR_BLACK, 100, 0,0,0,true, 128);
  61.                Waitframe();
  62.           }
  63.           while((tempOffset-=0.25) > scrollMinY)
  64.           {
  65.                Screen->Rectangle(OUTPUT_LAYER, 0,0,256,176, COLOUR_BLACK, 100, 0,0,0,true, 128);
  66.  
  67.                for (q = 0; q < numLines; ++q)
  68.                {
  69.                      Screen->DrawString(OUTPUT_LAYER, STRING_X, drawpos+(tempOffset<<0), STRING_FONT, STRING_COLOUR, 0, 0, strings[q], 128);
  70. drawpos += line_with_spacing;
  71.                }
  72.                Waitframe();
  73.           } //end scrolling loop loop
  74.           //Outro Black Screen
  75.           for ( q = 0; q < outroDur; ++q )
  76.           {
  77.                Screen->Rectangle(OUTPUT_LAYER, 0,0,256,176, COLOUR_BLACK, 100, 0,0,0,true, 128);
  78.                Waitframe();
  79.           }
  80.      } //end run()
  81. } //end script
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×