Hi everybody
i am new member this borad and at c programming.
i want to make a scrolling marquee (like a film cast list) from bottom to up. how i make this? this may be simple code.
note: excuse me for my bad english.
Hi everybody
i am new member this borad and at c programming.
i want to make a scrolling marquee (like a film cast list) from bottom to up. how i make this? this may be simple code.
note: excuse me for my bad english.
You probably don't want to do this in a programming language. It's pretty simple to do with flash. Look up tweening.
If you want to do it in C, post back. It's probably not as easy as Flash's (tweening?), but it's not difficult either.
> but it's not difficult either.
Wat? Yes it is. You basically have three options (if I'm not missing something):
- Setting up an entire GUI library and learning how to use it, and then finding out how to integrate custom animations
- Doing printf() alchemy with a lot of "\b" and sleep(), for a jittery textual rendering at best
- Exporting the (generated) animation as some external format (animated gif, .mov, .avi, etc), by using a library and/or learning how the files are created
Credit lists on films, are text based - no GUI is needed.
I don't recall the display being jittery, but a lot of that depends on your hardware, and settings on your software. I have seen MANY credits on films, that were jittery however - especially the low budget films.
I'm curious what this is for, because a type of video equipment has text display (including credit list generators), built into them. I can't imagine a videographer wouldn't have such a basic piece of equipment as that.
Sure if you want a generic font family and low budget jittery text and hours of pointless work, by all mean write it in c. If you want a professional smooth animation finished in under an hour, use flash.
This was the kind of thing I was referring to. It's text based, and it doesn't scroll smoothly.
Might be adequate for a school project, however.
Code:#include <stdio.h> #include <string.h> #include <time.h> int main(void) { int i,c,sizes[44]={0},lmargin[44]={0}; char *credits[]={"bride","Joanna Worthington","groom","Robert Sullivan","matron of honor", "Sue McIntyre","best man","John Smith","father of the bride","William Fox","mother of the bride", "Sharon Anderson","bride's ex","Tom Sanchez","maid of honor #1","Christine Li","maid of honor #2", "Selena Delgado","maid of honor #3","Alice Winegartner","grooms men #1","Jacque Glione", "grooms men #2","Bob Hardy","grooms men #3","Sven Johansson","minister","Steven Gomes", "videographer","Brice Carrolton","property manager","Cheryl Dafoe","director", "Richard Wu", "producer","Summit Entertainment","Mr. Wu's assistant","Dominique Sephardo","costume designer", "Denise Williams","Hair","Best Cuts","Catering","Food Best by Government Test"}; //get the sizes for(i=0;i<44;i+=2){ sizes[i] = strlen(credits[i]); //printf("sizes[i]: %d\n",sizes[i]); lmargin[i]=40-sizes[i]; } for(i=0;i<10;i++) printf("\n\n\n\n"); printf(" CAST\n\n"); for(i=0;i<43;i+=2) { for(c=0;c<lmargin[i];c++) putchar(' '); printf("%s %s\n",credits[i],credits[i+1]); _sleep(1); } printf("\n"); return 0; }
Last edited by Adak; 02-19-2012 at 01:04 PM.
thank u adak it was exactly I want but, when i want to compile this, it was closes immediately. then, i set the "_sleep(1);" >> "_sleep(1000);" ,,, it's run seamlessly.
well, how we eliminate the this list above up?
so, it shouldn't be done when the last line out from bottom.
it should be done while the last line above up.
how i do this?
sorry my english is bad
Hollywood's best sequel! Even more breathtaking!!
Well, simpler anyway. XDCode:#include <stdio.h> #include <time.h> #define MAX 120 #define MAXRows 43 int main(void) { int i; char *credits[]={"bride","Joanna Worthington","groom","Robert Sullivan","matron of honor", "Sue McIntyre","best man","John Smith","father of the bride","William Fox","mother of the bride", "Sharon Anderson","bride's ex","Tom Sanchez","maid of honor #1","Christine Li","maid of honor #2", "Selena Delgado","maid of honor #3","Alice Winegartner","grooms men #1","Jacque Glione", "grooms men #2","Bob Hardy","grooms men #3","Sven Johansson","minister","Steven Gomes", "videographer","Brice Carrolton","property manager","Cheryl Dafoe","director", "Richard Wu", "producer","Dujour Entertainment","Mr. Wu's assistant","Dominique Sephardo","costume designer", "Denise Williams","Hair","Best Cuts","Catering","Food Best by Government Test","*"}; for(i=0;i<10;i++) printf("\n\n\n\n"); printf(" CAST\n\n"); i=0; while(credits[i]!= "*") { printf("%40s %s\n",credits[i],credits[i+1]); _sleep(1); i+=2; } for(i=0;i<MAXRows;i++) { putchar('\n'); _sleep(1); } printf("\n"); return 0; }
you are amazing adak ! thank you much.
vvCode:while (credits[i] != "*")
:PCode:#include <string.h> /* ... */ while (strcmp(credits[i], "*"))