scroll past 85 pixels (feature title) of place

This commit is contained in:
Justin 2023-08-17 16:03:09 +08:00 committed by GitHub
parent 0abad58446
commit a4060214ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,11 +132,15 @@ class StockTicker():
(r, g, b) = pixels[x, y]
self.matrix.SetPixel(x + offset_x, y + offset_y, r*self.brightness, g*self.brightness, b*self.brightness)
def scrollImage(self, image, offset_x = 0, offset_y = 0, frame_skip = 10, gif = False, pause_frames = 0):
def scrollImage(self, image, offset_x = 0, offset_y = 0, frame_skip = 10, gif = False, pause_frames = 0, place = False)):
img_width, img_height = image.size
kill = False
if place:
value = -85
else:
value = 0
while offset_x > -(img_width+1):
if offset_x == 0:
if offset_x == value:
while pause_frames > 0:
if pause_frames%frame_skip == 0:
self.incrementGIF(image)
@ -435,7 +439,7 @@ class StockTicker():
except:
pause = 0
pause_frames = int(float(pause)/self.delay)
kill = self.scrollImage(image, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = options[i % len(options)] == 'Custom GIFs', pause_frames = pause_frames)
kill = self.scrollImage(image, offset_x = offset_x, offset_y = offset_y, frame_skip = frame_skip, gif = options[i % len(options)] == 'Custom GIFs', pause_frames = pause_frames, place = options[i % len(options)] == 'r/place (Reddit)')
if kill: break
if kill:break