|
9 | 9 | display = tft_gizmo.TFT_Gizmo() |
10 | 10 |
|
11 | 11 | # loading the background image |
12 | | -bg_bitmap, bg_palette = adafruit_imageload.load("/clouds_bg.bmp", |
13 | | - bitmap=displayio.Bitmap, |
14 | | - palette=displayio.Palette) |
| 12 | +bg_bitmap, bg_palette = adafruit_imageload.load( |
| 13 | + "/clouds_bg.bmp", bitmap=displayio.Bitmap, palette=displayio.Palette |
| 14 | +) |
15 | 15 | bg_grid = displayio.TileGrid(bg_bitmap, pixel_shader=bg_palette) |
16 | 16 |
|
17 | 17 | # loading the crescent moon bitmap sequence |
18 | | -bitmap, palette = adafruit_imageload.load("/moon_anime.bmp", |
19 | | - bitmap=displayio.Bitmap, |
20 | | - palette=displayio.Palette) |
| 18 | +bitmap, palette = adafruit_imageload.load( |
| 19 | + "/moon_anime.bmp", bitmap=displayio.Bitmap, palette=displayio.Palette |
| 20 | +) |
21 | 21 | # makes the black background transparent so we only see the cresent moon |
22 | 22 | palette.make_transparent(0) |
23 | 23 |
|
24 | | -tile_grid = displayio.TileGrid(bitmap, pixel_shader=palette, width = 1, height = 1, |
25 | | - tile_height = 120, tile_width = 120, |
26 | | - default_tile = 0) |
| 24 | +tile_grid = displayio.TileGrid( |
| 25 | + bitmap, |
| 26 | + pixel_shader=palette, |
| 27 | + width=1, |
| 28 | + height=1, |
| 29 | + tile_height=120, |
| 30 | + tile_width=120, |
| 31 | + default_tile=0, |
| 32 | +) |
27 | 33 |
|
28 | 34 | # two circles for the center "jewel" |
29 | | -jewel_outline = Circle(x0=120, y0=120, r=40, fill=0xfbf236) |
30 | | -jewel = Circle(x0=120, y0=120, r=35, fill=0xf70570) |
| 35 | +jewel_outline = Circle(x0=120, y0=120, r=40, fill=0xFBF236) |
| 36 | +jewel = Circle(x0=120, y0=120, r=35, fill=0xF70570) |
31 | 37 |
|
32 | 38 | # adding the two jewel circle elements to a group |
33 | | -jewel_splash = displayio.Group(max_size=20) |
| 39 | +jewel_splash = displayio.Group() |
34 | 40 | jewel_splash.append(jewel_outline) |
35 | 41 | jewel_splash.append(jewel) |
36 | 42 |
|
37 | 43 | # making a group for the crescent moon sequence |
38 | 44 | # scale is 2 because at full 240x240 resolution image is too big |
39 | | -moon_group = displayio.Group(scale = 2) |
| 45 | +moon_group = displayio.Group(scale=2) |
40 | 46 | # group to hold all of the display elements |
41 | 47 | main_group = displayio.Group() |
42 | 48 |
|
|
74 | 80 | # runs crescent moon animation |
75 | 81 | if not music_playing and not animation_pause: |
76 | 82 | # every .8 seconds... |
77 | | - if (crescent + .8) < time.monotonic(): |
| 83 | + if (crescent + 0.8) < time.monotonic(): |
78 | 84 | # the moon animation cycles |
79 | 85 | tile_grid[0] = moon |
80 | 86 | # moon is the tilegrid index location |
|
0 commit comments