Skip to content

Adds Animation Scenario#2352

Merged
tig merged 6 commits intogui-cs:developfrom
tznind:animation
Feb 20, 2023
Merged

Adds Animation Scenario#2352
tig merged 6 commits intogui-cs:developfrom
tznind:animation

Conversation

@tznind
Copy link
Copy Markdown
Collaborator

@tznind tznind commented Feb 17, 2023

I was thinking about how to get some more flashy demo Scenarios and knocked this together.

One of the common pitfalls users have is how to update UI from another thread so I have just used the basic Task class and Application.MainLoop.Invoke.

Hopefully the Scenario achieves the following

  • Shows how to draw arbitrary content in a View by subclassing
  • How to properly update UI from another Thread/Task
  • That Terminal.Gui is fast and flashy and awesome!

braille-globe

I've added a dependency on 'SixLabours.ImageSharp' into UICatalog (but not main Terminal.Gui). I think if we are doing more truecolor stuff later on we will need an image library anyway for use in Scenarios that demo the full potential (e.g. open an image and show on screen in glorious truecolor).

The image itself is Community Commons attribution (which allows remixing).

I've used Braille for rendering by porting this nice algorithm which is MIT licensed (by Andraaspar) see https://github.com/andraaspar/bitmap-to-braille by

Sadly older terminals are not going to render Braille which might be a deal breaker. But it was fun to code so even if its not merge worthy I think it was still worthwhile.

Anyway let me know what you think. Another thought I had was whether given the new LineCanvas stuff I could code 'snake'... should be pretty easy.

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

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