We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Spurred by https://twitter.com/TAThorogood/status/1284650865991626754?s=20, some basic bits of a content layout system could be useful.
We could start with methods for centering content in an array, arr.center(content) I suppose?
arr.center(content)
The text was updated successfully, but these errors were encountered:
Sorry, I'm confused. Arr.center is just window.width - len(content) // 2? Or is it something more?
window.width - len(content) // 2
Sorry, something went wrong.
Yes roughly, plus on the vertical axis. Like
arr = FSArray(window.height, window.width) arr.center("hello")
producing something like (if it's side-effecting, I have no idea what I was thinking at the time)
hello
so equivalent to
arr = FSArray(window.height, window.width) arr[arr.height // 2][arr.width - len(content) // 2 : arr.width + (len(content) + 1) // 2] = content
No branches or pull requests
Spurred by https://twitter.com/TAThorogood/status/1284650865991626754?s=20, some basic bits of a content layout system could be useful.
We could start with methods for centering content in an array,
arr.center(content)
I suppose?The text was updated successfully, but these errors were encountered: