olls / graphics

A console based graphics engine for simple Unicode games and animations.
GNU General Public License v3.0
11 stars 4 forks source link

Terminal Resize #21

Closed olls closed 10 years ago

olls commented 10 years ago

There should be an option, or a way to determine when the terminal size changes and deal with it.

geraintwhite commented 10 years ago

There is, rerun console.py On 16 Jan 2014 23:27, "Oliver Faircliff" notifications@github.com wrote:

There should be an option, or a way to determine when the terminal size changes and deal with it.

— Reply to this email directly or view it on GitHubhttps://github.com/olls/graphics/issues/21 .

olls commented 10 years ago

I know, I meant an attribute of the canvas which you can enable to let it do this for you. On 17 Jan 2014 07:06, "Geraint White" notifications@github.com wrote:

There is, rerun console.py On 16 Jan 2014 23:27, "Oliver Faircliff" notifications@github.com wrote:

There should be an option, or a way to determine when the terminal size changes and deal with it.

— Reply to this email directly or view it on GitHub< https://github.com/olls/graphics/issues/21> .

— Reply to this email directly or view it on GitHubhttps://github.com/olls/graphics/issues/21#issuecomment-32584330 .

olls commented 10 years ago

97c275512487d6a37dbcce86d00c2160f6d30b88 I added a fullscreen attribute to the Canvas which will always re-size the canvas to the full terminal size. In some cases (eg clock.py) you don't want this because then you have to center everything by yourself, so the other way to do it (demonstrated in clock.py) is to re-scale the canvas manually and then the canvas will still center it for you. They end up with quite similar results, but sometimes one is more practical than the other.