diff options
author | Martin Ashby <martin@martin-laptop.lan> | 2018-05-17 18:18:11 +0100 |
---|---|---|
committer | Martin Ashby <martin@martin-laptop.lan> | 2018-05-17 18:18:11 +0100 |
commit | d40c7d9f09d9b012837d6060a4c598b23b19646f (patch) | |
tree | 8fa1f99664b3b6a74f7a0fd5856b7d0c41767b1f /unicorn_hat_sim.py | |
parent | aa86cb02fd95404fdfba8cf9d13cb5c18138b6b5 (diff) | |
download | unicornpaint-d40c7d9f09d9b012837d6060a4c598b23b19646f.tar.gz unicornpaint-d40c7d9f09d9b012837d6060a4c598b23b19646f.tar.bz2 unicornpaint-d40c7d9f09d9b012837d6060a4c598b23b19646f.tar.xz unicornpaint-d40c7d9f09d9b012837d6060a4c598b23b19646f.zip |
Palette, tools, load & save working
Diffstat (limited to 'unicorn_hat_sim.py')
-rw-r--r-- | unicorn_hat_sim.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/unicorn_hat_sim.py b/unicorn_hat_sim.py index 9d7d1a0..c2cd8b1 100644 --- a/unicorn_hat_sim.py +++ b/unicorn_hat_sim.py @@ -27,7 +27,8 @@ class UnicornHatSim(object): pygame.init() pygame.display.set_caption("Unicorn HAT simulator") self.screen = pygame.display.set_mode([self.window_width, self.window_height]) - self.clear() + # self.clear() + self.screen.fill((0, 0, 0)) def set_pixel(self, x, y, r, g, b): i = (x * self.width) + y @@ -55,7 +56,8 @@ class UnicornHatSim(object): self.draw_led(x, y) def show(self): - self.clear() + # self.clear() + self.screen.fill((0, 0, 0)) self.draw() pygame.display.flip() @@ -81,8 +83,9 @@ class UnicornHatSim(object): self._rotation = int(round(r/90.0)) % 3 def clear(self): - self.screen.fill((0, 0, 0)) - + # self.screen.fill((0, 0, 0)) + self.pixels = [(0, 0, 0)] * self.width * self.height + def get_rotation(self): return self._rotation * 90 |