KingNook / 2048

https://kingnook.github.io/2048/
1 stars 0 forks source link

Make grid responsive #23

Open KingNook opened 1 month ago

KingNook commented 1 month ago

Context

So after opening #21 I realized the grid itself also needs to be resizable. Which means not only the window size (which seems easy enough, see linked stack overflow post in #21) but also the grid size and position. And the tile size. And the text size.

Thoughts / Challenges

Dynamic text size may be a challenge. I'll leave #4 open for now despite it being partially covered by the scope of this since I envisage it being the biggest pain to deal with. For the rest of them, I reckon using the @property decorator for all of them to scale wrt self.window_size would be the easiest way to do this (then on window resize, change <instance>.window_size and call <instance>.draw_grid() to update the image.

I do still suspect this'll be a pretty big task though