Read Mode

Simple Animation In Cmd Console | Intermediate

Simple Animation In Cmd Console | Intermediate
Path of the Dot displayed.

As we All know that Batch Programming is Basically CUI [Character User Interface] Which means , that You have to tell PC, what to do by typing On keyboard and Your PC gives you Response in form of Characters (or Sentences) on the monitor... i.e. All the Exchange of data and information is in the form of Characters ... Thus Making Graphical Animation in CUI is the method how our these days GUI tech. Comes from it ???

Trick Used:
For making Simple animation in this type of Programming language is Pretty-much Difficult, but there is always a way... As cmd not comes with the utility of changing Co-ordinates of input cursor (i.e. we can't say like 'gotoXY(5,6)' as we use in C or CPP ... so we need to take a Different Road for our Goal ...

Simple Animation In Cmd Console | Intermediate
Further movement path

In this Batch Script... what I've Done is , I had simply leave Y lines empty for y - ordinate, and filled X spaces before our animated Item for x abscissa. which gives me utility like 'gotoXY (X,Y)' in batch ...

e.g. If I have to goto the co-ordinate (5,5), then simply I will leave 4 empty lines in the console and put 4 spaces before the character to be printed (as width of charcater is '1'). So, We'll reach to the point 5,5 Indirectly. 

This method is only possible, when There is no other data on the console screen and you just need to move the cursor around. But when there is some data on the cmd screen, then This trick may result into data loss from the console screen. hence, In those cases, It is adviced to use external plugin instead of Doing this complicated trick for your program.

Keep learning, keep sharing…
Be happy, spread happiness…

Download Link: Simple Animation.Bat

You May Also Like : Swap Mouse Buttons by Batch

No comments:

Powered by Blogger.