peterbrittain / asciimatics

A cross platform package to do curses-like operations, plus higher level APIs and widgets to create text UIs and ASCII art animations
Apache License 2.0
3.61k stars 238 forks source link

Support multi-line text rolling in a rect #382

Closed Daniel-Chin closed 10 months ago

Daniel-Chin commented 10 months ago

Is your feature request related to a problem? Please describe. This feature would enhance UI capabilities.

Describe the solution you'd like An interface such as Screen.print_rolled_text_at(text: str, x: int, y: int, w: int, h: int, do_clip: bool)

Describe alternatives you've considered I implemented my own text rolling util. Feel free to copy. It even considers CJK char width...

Additional context Text rolling is infamously non-trivial, so I'd like an in-library implementation. Pain points:

peterbrittain commented 10 months ago

Thanks for getting in touch. Can you explain your thinking a lttile more?

In particular, how are you trying to use this function and have you tried any of the options already available in asciimatics:

I think that they cover your existing rollText implementation...

Daniel-Chin commented 10 months ago

Thank you for paying attention!

With the help of your reference, I see that widgets.utilities._split_text() perfectly implements my request. Good work, and thanks greatly for making this library available!

peterbrittain commented 10 months ago

Great! And thanks!!