Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

機能追加: 描画範囲のみ再描画 #1

Merged
merged 6 commits into from
Feb 11, 2019

Conversation

Cj-bc
Copy link
Contributor

@Cj-bc Cj-bc commented Feb 11, 2019

こんにちは、twitterで見かけたので少し書いてみました!
tputを使用して、絵文字の表示範囲のみを再描画するようにしました。
これにより、以下のようなことができるようになります。

  • 他の出力を消さずに動かす
  • 周りに装飾をつける

feature-redraw-only-animation

Before:
  - can't echo any letters as banner.
What was the problem:
  - (I think) the reason was that 'frames' was associative array.
    - How to assign to associative array: `frames[key]="value"`
    - How to assign to an ordinary array: `frames[0]="value"`
What do they do?:
  - `trap 'tput cnorm;exit' SIGTERM SIGINT` defines TRAP for SIGTREM/SIGINT signal.
  - `tput cnorm` clear some cursor effects(civis/cvvis). It's stands for 'cursor normal.'
  - `tput civis` hides the cursor so that our eyes won't hurt. It's
stands for 'cursor invisible'. <=> `tput cvis`
  - `tput sc` saves the current cursor position.
  - `tput rc` restore cursor position which was saved via `tput sc`
I've add those margin to erase all characters properly with 'tput rc'
@Uynet
Copy link
Owner

Uynet commented Feb 11, 2019

ありがとうございます!

@Uynet Uynet closed this Feb 11, 2019
@Uynet Uynet reopened this Feb 11, 2019
@Uynet Uynet merged commit ce6459a into Uynet:master Feb 11, 2019
Uynet pushed a commit that referenced this pull request Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants