GithubHelp home page GithubHelp logo

asciimation's People

Contributors

octobanana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

asciimation's Issues

Allow functions to generate single frames

From a reddit threat:

Nice.
This still seems to be a lot of work, though. The plane file has 814 lines. Wouldn't it be nice to allow specifying a function (with frame number, width and hight as arguments) and use its output as the image of the frame?

I wrote an example how this could look (simple bash script written today in the tramway, so don't expect too much of it):

#!/usr/bin/env bash

function scroll  {
    scroll_by=$1
    max_length=$2
    line=$3
    end_chars=$(printf %"$max_length"s)
    # from the string $line take the last $scroll_by chars, then take
    # only the last max_lenght chars of those.
    echo -n "$end_chars" "$line" | tail -c $scroll_by  | head -c $max_length
    # if the newline in the command above wouldn't be suppressed it
    # might be cut away by head, so we add it here afterwards
    echo ""
}

function plane {
    # naming the arguments for readability
    frame=$1
    width=$2
    height=$3

    case $(($frame%4)) in
        0)
            scroll $frame $width "/----------------------\              ___               "
            scroll $frame $width "|                      |              \~~\_____/~~\__   "
            scroll $frame $width "|      Automation      |______________ \______====== )-+"
            scroll $frame $width "|                      |                       ~~|/~~   "
            scroll $frame $width "\----------------------/                         ()     "
            ;;
        2)
            scroll $frame $width "/----------------------\              ___               "
            scroll $frame $width "|                      |              \~~\_____/~~\__  |"
            scroll $frame $width "|      Automation      |______________ \______====== )-+"
            scroll $frame $width "|                      |                       ~~|/~~  |"
            scroll $frame $width "\----------------------/                         ()     "
            ;;
        [1,3])
            scroll $frame $width "/----------------------\              ___               "
            scroll $frame $width "|                      |              \~~\_____/~~\__  ."
            scroll $frame $width "|      Automation      |______________ \______====== )-+"
            scroll $frame $width "|                      |                       ~~|/~~  '"
            scroll $frame $width "\----------------------/                         ()     "
            ;;
    esac
}

# main
clear
for i in $(seq 150);
do
    plane $i 50 5
    sleep 0.08
    clear
done

I think it provides a simpler way to compose animations and to adapt them later (like in the example to add another frame to the plane.

Per-frame view widget?

Hey there,

I have a project in ruby where I use animated ASCII. I collect these
into standalone text files though.

Is it possible for asciimation to also show/dump these text files?
I could then e. g. display them on the web-browser via javascript
just to give a use case.

IF this would be possible it would be great if the main README
could have one short example in how to make this work; it
suffices to just dump this on the commandline, don't need
anything fancy. I do understand that this is just a hobby
project though. :)

Hotkey for abort.

Esc or something to exit (eg. for infinitely loops).

Pressing ^C works, but the VT stuck and you have to kill it.

compile error on gcc 8.3

Error is below
ๅ›พ็‰‡

I fiixed it using below code

      size_t x = 0;
      size_t y = 0;
      Term::cursor_get(x, y);
      std::vector<std::string> flags { AEC::bold, AEC::reverse };  // change 1
      
      std::cout
      << AEC::cursor_set(0, 0)
      << AEC::wrap("||", flags)   // change 2

btw, it's an awesome tool!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.