Skip to content Skip to sidebar Skip to footer

Ascii - Asciimatics - How To Implement Effects/screens Into The Code

Few posts ago somebody suggested me to look into Asciimatics library for Python. i'm trying to get my head around it, using: samples - https://github.com/peterbrittain/asciimatics

Solution 1:

It all depends on how you implement your new Effects... In short you need a strategy for clearing old images.

The best way to animate your aplication is to use double-buffering and just draw each new image afresh. This is the technique used inside asciimatics to prevent artifacts as you redraw the Screen. Unfortunately, it doesn't clear the Screen as you swap buffers (on refresh) and so you need to do that yourself (in v1.x). Once you have done that, you can draw overlays as needed, using separate Effects if that helps.

For example, if you made the wall the bottom Effect and made it clear the whole screen as well as drawing the walls, then your other Effects just need to draw their current image without clearing the old.

Post a Comment for "Ascii - Asciimatics - How To Implement Effects/screens Into The Code"