static void spitbox(int ix, int y, char *s) { float bw; /* box width */ char d[256], *t, *z; int a, i, x = ix+1; char *color = "black"; if (y > 0) { stepnumber(y); } bw = (float)1.8*(float)strlen(s); /* guess at default font width */ colbox(x, y, (int) (bw+1.0), 5, "black"); if (s[0] == '~') { switch (s[1]) { default : case 'R': color = "red"; break; case 'B': color = "blue"; break; case 'G': color = "green"; break; } s += 2; } else if (strchr(s, '!')) { color = "ivory"; } else if (strchr(s, '?')) { color = "azure"; } else { color = "pink"; if (sscanf(s, "%d:%250s", &a, d) == 2 && a >= 0 && a < TotSteps) { if (!I[a] || strlen(I[a]) <= strlen(s)) { I[a] = (char *) emalloc((int) strlen(s)+1); } strcpy(I[a], s); } } colbox(x, y, (int) bw, 4, color); z = t = (char *) emalloc(2*strlen(s)+1); for (i = 0; i < strlen(s); i++) { if (s[i] == '\n') { continue; } if (s[i] == '[' || s[i] == ']') { *t++ = '\\'; } *t++ = s[i]; } fprintf(pfd, ".c create text %d %d -text \"%s\"\n", xscale*x*WW-20, yscale*y*HH+20, z); }
void spitbox(int x, int dx, int y, char *s) { float r,g,b, bw; int a; char d[256]; if (!dx) { stepnumber(y); putgrid(x); } bw = (float)2.7*(float)strlen(s); colbox(x*WW+dx, MH-(y*HH)%MH, (int) (bw+1.0), 5, (float) 0.,(float) 0.,(float) 0.); if (s[0] == '~') { switch (s[1]) { case 'B': r = (float) 0.2; g = (float) 0.2; b = (float) 1.; break; case 'G': r = (float) 0.2; g = (float) 1.; b = (float) 0.2; break; case 'R': default : r = (float) 1.; g = (float) 0.2; b = (float) 0.2; break; } s += 2; } else if (strchr(s, '!')) { r = (float) 1.; g = (float) 1.; b = (float) 1.; } else if (strchr(s, '?')) { r = (float) 0.; g = (float) 1.; b = (float) 1.; } else { r = (float) 1.; g = (float) 1.; b = (float) 0.; if (!dx && sscanf(s, "%d:%250s", &a, d) == 2 /* was &d */ && a >= 0 && a < TotSteps) { if (!I[a] || strlen(I[a]) <= strlen(s)) I[a] = emalloc((int) strlen(s)+1); strcpy(I[a], s); } } colbox(x*WW+dx, MH-(y*HH)%MH, (int) bw, 4, r,g,b); fprintf(pfd, "gsave\n"); fprintf(pfd, "/Courier-Bold findfont 8 scalefont "); fprintf(pfd, "ISOEncode setfont\n"); fprintf(pfd, "0.000 0.000 0.000 setrgbcolor AdjustColor\n"); fprintf(pfd, "%d %d [\n", x*WW+dx, MH-(y*HH)%MH); fprintf(pfd, " (%s)\n] 10 -0.5 0.5 0 ", s); fprintf(pfd, "false DrawText\ngrestore\n"); }
void funccall::ss() { int v; struct dostime_t t; struct dosdate_t d; do { textbackground(BLUE); textcolor(MAGENTA); _setcursortype(_NORMALCURSOR); clrscr(); textcolor(GREEN); box(4,4,4,4); box(4,4,6,6); textcolor(GREEN+BLINK); gotoxy(11,7); cputs("CREEPER"); delay(502); _dos_gettime(&t); _dos_getdate(&d); box(21,6,52,4,222); gotoxy(54,6); printf("DATE:%2d/%02d/%02d\n",d.day,d.month,d.year); gotoxy(54,7); printf("Time:%2d:%02d:%02d.%02d\n",t.hour,t.minute,t.second,t.hsecond); gotoxy(25,9); textcolor(WHITE+BLINK); cputs(">>>> SCREEN SAVERS >>>>"); box(35,10,20,11); textcolor(WHITE); gotoxy(22,12); cputs("1. COLOUR BOX"); gotoxy(22,13); cputs("2. WELCOME NOTE"); gotoxy(22,14); cputs("3. CREEPER BOOTING"); gotoxy(22,15); cputs("4. CREEPER ALL THE WAY"); gotoxy(22,16); cputs("0. MAIN MENU"); gotoxy(25,18); cputs("ENTER THE CHOICE NUMBER : "); v=int(getche()-48); delay(100); if(v) { switch(v) { case 1: colbox(); break; case 2: wel(); break; case 3: intro(); break; case 4: crepalltheway(); break; default: gotoxy(27,20); cputs("INVALID ENTRY"); delay(1000); break; }} }while(v!=0); }