Text Animation Program in C graphics
Here you will learn to create a text animation program in c programming. To make this animation program, We will use of some c graphics functions like settextstyle, outtextxy, cleardevice() and c loops.
Program of Text Animation in C graphics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | //Moving text animation in c graphics #include <stdio.h> #include <conio.h> #include <stdlib.h> #include<dos.h> #include<graphics.h> int main() { int a,i,gd = DETECT, gm; initgraph(&gd, &gm, "C:\\Turboc3\\BGI"); settextstyle(2,0,8); for(i=0;i<=150;i=i+2) { outtextxy(i,200,"Welcome to CodeRevise.com"); delay(50); cleardevice(); if(i>=100) { for(i=150;i>=1;i=i-8) { outtextxy(i,200,"Welcome to CodeRevise.com"); delay(30); cleardevice(); } } if(kbhit()) {exit(1); } } } |
Output