Bladeren bron

pre-generated qr codes and scrolling text on pico.

Thomas Buck 1 jaar geleden
bovenliggende
commit
4d8087756f
6 gewijzigde bestanden met toevoegingen van 593 en 24 verwijderingen
  1. 1
    0
      .gitignore
  2. 520
    0
      camp_pico.py
  3. 4
    0
      copy.sh
  4. 16
    4
      pico.py
  5. 50
    19
      qr.py
  6. 2
    1
      scroll.py

+ 1
- 0
.gitignore Bestand weergeven

@@ -1 +1,2 @@
1 1
 __pycache__
2
+qr_tmp.txt

+ 520
- 0
camp_pico.py Bestand weergeven

@@ -0,0 +1,520 @@
1
+#!/usr/bin/env python3
2
+
3
+# ----------------------------------------------------------------------------
4
+# "THE BEER-WARE LICENSE" (Revision 42):
5
+# <xythobuz@xythobuz.de> wrote this file.  As long as you retain this notice
6
+# you can do whatever you want with this stuff. If we meet some day, and you
7
+# think this stuff is worth it, you can buy me a beer in return.   Thomas Buck
8
+# ----------------------------------------------------------------------------
9
+
10
+camp_pink = (251, 72, 196)
11
+camp_green = (63, 255, 33)
12
+
13
+# QR code image for "Hello World"
14
+# size:21x21
15
+qr_data = [
16
+    [
17
+        (255, 255, 255),
18
+        (255, 255, 255),
19
+        (255, 255, 255),
20
+        (255, 255, 255),
21
+        (255, 255, 255),
22
+        (255, 255, 255),
23
+        (255, 255, 255),
24
+        (0, 0, 0),
25
+        (0, 0, 0),
26
+        (255, 255, 255),
27
+        (0, 0, 0),
28
+        (0, 0, 0),
29
+        (255, 255, 255),
30
+        (0, 0, 0),
31
+        (255, 255, 255),
32
+        (255, 255, 255),
33
+        (255, 255, 255),
34
+        (255, 255, 255),
35
+        (255, 255, 255),
36
+        (255, 255, 255),
37
+        (255, 255, 255),
38
+    ],
39
+    [
40
+        (255, 255, 255),
41
+        (0, 0, 0),
42
+        (0, 0, 0),
43
+        (0, 0, 0),
44
+        (0, 0, 0),
45
+        (0, 0, 0),
46
+        (255, 255, 255),
47
+        (0, 0, 0),
48
+        (255, 255, 255),
49
+        (0, 0, 0),
50
+        (255, 255, 255),
51
+        (255, 255, 255),
52
+        (0, 0, 0),
53
+        (0, 0, 0),
54
+        (255, 255, 255),
55
+        (0, 0, 0),
56
+        (0, 0, 0),
57
+        (0, 0, 0),
58
+        (0, 0, 0),
59
+        (0, 0, 0),
60
+        (255, 255, 255),
61
+    ],
62
+    [
63
+        (255, 255, 255),
64
+        (0, 0, 0),
65
+        (255, 255, 255),
66
+        (255, 255, 255),
67
+        (255, 255, 255),
68
+        (0, 0, 0),
69
+        (255, 255, 255),
70
+        (0, 0, 0),
71
+        (0, 0, 0),
72
+        (255, 255, 255),
73
+        (0, 0, 0),
74
+        (0, 0, 0),
75
+        (255, 255, 255),
76
+        (0, 0, 0),
77
+        (255, 255, 255),
78
+        (0, 0, 0),
79
+        (255, 255, 255),
80
+        (255, 255, 255),
81
+        (255, 255, 255),
82
+        (0, 0, 0),
83
+        (255, 255, 255),
84
+    ],
85
+    [
86
+        (255, 255, 255),
87
+        (0, 0, 0),
88
+        (255, 255, 255),
89
+        (255, 255, 255),
90
+        (255, 255, 255),
91
+        (0, 0, 0),
92
+        (255, 255, 255),
93
+        (0, 0, 0),
94
+        (0, 0, 0),
95
+        (255, 255, 255),
96
+        (0, 0, 0),
97
+        (0, 0, 0),
98
+        (0, 0, 0),
99
+        (0, 0, 0),
100
+        (255, 255, 255),
101
+        (0, 0, 0),
102
+        (255, 255, 255),
103
+        (255, 255, 255),
104
+        (255, 255, 255),
105
+        (0, 0, 0),
106
+        (255, 255, 255),
107
+    ],
108
+    [
109
+        (255, 255, 255),
110
+        (0, 0, 0),
111
+        (255, 255, 255),
112
+        (255, 255, 255),
113
+        (255, 255, 255),
114
+        (0, 0, 0),
115
+        (255, 255, 255),
116
+        (0, 0, 0),
117
+        (255, 255, 255),
118
+        (255, 255, 255),
119
+        (255, 255, 255),
120
+        (0, 0, 0),
121
+        (255, 255, 255),
122
+        (0, 0, 0),
123
+        (255, 255, 255),
124
+        (0, 0, 0),
125
+        (255, 255, 255),
126
+        (255, 255, 255),
127
+        (255, 255, 255),
128
+        (0, 0, 0),
129
+        (255, 255, 255),
130
+    ],
131
+    [
132
+        (255, 255, 255),
133
+        (0, 0, 0),
134
+        (0, 0, 0),
135
+        (0, 0, 0),
136
+        (0, 0, 0),
137
+        (0, 0, 0),
138
+        (255, 255, 255),
139
+        (0, 0, 0),
140
+        (0, 0, 0),
141
+        (0, 0, 0),
142
+        (255, 255, 255),
143
+        (0, 0, 0),
144
+        (255, 255, 255),
145
+        (0, 0, 0),
146
+        (255, 255, 255),
147
+        (0, 0, 0),
148
+        (0, 0, 0),
149
+        (0, 0, 0),
150
+        (0, 0, 0),
151
+        (0, 0, 0),
152
+        (255, 255, 255),
153
+    ],
154
+    [
155
+        (255, 255, 255),
156
+        (255, 255, 255),
157
+        (255, 255, 255),
158
+        (255, 255, 255),
159
+        (255, 255, 255),
160
+        (255, 255, 255),
161
+        (255, 255, 255),
162
+        (0, 0, 0),
163
+        (255, 255, 255),
164
+        (0, 0, 0),
165
+        (255, 255, 255),
166
+        (0, 0, 0),
167
+        (255, 255, 255),
168
+        (0, 0, 0),
169
+        (255, 255, 255),
170
+        (255, 255, 255),
171
+        (255, 255, 255),
172
+        (255, 255, 255),
173
+        (255, 255, 255),
174
+        (255, 255, 255),
175
+        (255, 255, 255),
176
+    ],
177
+    [
178
+        (0, 0, 0),
179
+        (0, 0, 0),
180
+        (0, 0, 0),
181
+        (0, 0, 0),
182
+        (0, 0, 0),
183
+        (0, 0, 0),
184
+        (0, 0, 0),
185
+        (0, 0, 0),
186
+        (0, 0, 0),
187
+        (255, 255, 255),
188
+        (0, 0, 0),
189
+        (255, 255, 255),
190
+        (255, 255, 255),
191
+        (0, 0, 0),
192
+        (0, 0, 0),
193
+        (0, 0, 0),
194
+        (0, 0, 0),
195
+        (0, 0, 0),
196
+        (0, 0, 0),
197
+        (0, 0, 0),
198
+        (0, 0, 0),
199
+    ],
200
+    [
201
+        (255, 255, 255),
202
+        (0, 0, 0),
203
+        (255, 255, 255),
204
+        (0, 0, 0),
205
+        (255, 255, 255),
206
+        (0, 0, 0),
207
+        (255, 255, 255),
208
+        (0, 0, 0),
209
+        (0, 0, 0),
210
+        (255, 255, 255),
211
+        (255, 255, 255),
212
+        (255, 255, 255),
213
+        (0, 0, 0),
214
+        (0, 0, 0),
215
+        (0, 0, 0),
216
+        (0, 0, 0),
217
+        (255, 255, 255),
218
+        (0, 0, 0),
219
+        (0, 0, 0),
220
+        (255, 255, 255),
221
+        (0, 0, 0),
222
+    ],
223
+    [
224
+        (0, 0, 0),
225
+        (255, 255, 255),
226
+        (0, 0, 0),
227
+        (255, 255, 255),
228
+        (255, 255, 255),
229
+        (0, 0, 0),
230
+        (0, 0, 0),
231
+        (255, 255, 255),
232
+        (255, 255, 255),
233
+        (0, 0, 0),
234
+        (0, 0, 0),
235
+        (0, 0, 0),
236
+        (0, 0, 0),
237
+        (0, 0, 0),
238
+        (255, 255, 255),
239
+        (255, 255, 255),
240
+        (255, 255, 255),
241
+        (0, 0, 0),
242
+        (0, 0, 0),
243
+        (255, 255, 255),
244
+        (255, 255, 255),
245
+    ],
246
+    [
247
+        (0, 0, 0),
248
+        (255, 255, 255),
249
+        (0, 0, 0),
250
+        (0, 0, 0),
251
+        (0, 0, 0),
252
+        (0, 0, 0),
253
+        (255, 255, 255),
254
+        (255, 255, 255),
255
+        (255, 255, 255),
256
+        (0, 0, 0),
257
+        (255, 255, 255),
258
+        (0, 0, 0),
259
+        (255, 255, 255),
260
+        (255, 255, 255),
261
+        (0, 0, 0),
262
+        (255, 255, 255),
263
+        (255, 255, 255),
264
+        (255, 255, 255),
265
+        (255, 255, 255),
266
+        (255, 255, 255),
267
+        (255, 255, 255),
268
+    ],
269
+    [
270
+        (0, 0, 0),
271
+        (255, 255, 255),
272
+        (255, 255, 255),
273
+        (0, 0, 0),
274
+        (255, 255, 255),
275
+        (255, 255, 255),
276
+        (0, 0, 0),
277
+        (255, 255, 255),
278
+        (255, 255, 255),
279
+        (255, 255, 255),
280
+        (0, 0, 0),
281
+        (0, 0, 0),
282
+        (0, 0, 0),
283
+        (0, 0, 0),
284
+        (0, 0, 0),
285
+        (0, 0, 0),
286
+        (255, 255, 255),
287
+        (0, 0, 0),
288
+        (0, 0, 0),
289
+        (255, 255, 255),
290
+        (0, 0, 0),
291
+    ],
292
+    [
293
+        (0, 0, 0),
294
+        (255, 255, 255),
295
+        (0, 0, 0),
296
+        (255, 255, 255),
297
+        (255, 255, 255),
298
+        (0, 0, 0),
299
+        (255, 255, 255),
300
+        (0, 0, 0),
301
+        (255, 255, 255),
302
+        (255, 255, 255),
303
+        (255, 255, 255),
304
+        (0, 0, 0),
305
+        (255, 255, 255),
306
+        (255, 255, 255),
307
+        (0, 0, 0),
308
+        (255, 255, 255),
309
+        (255, 255, 255),
310
+        (0, 0, 0),
311
+        (0, 0, 0),
312
+        (0, 0, 0),
313
+        (0, 0, 0),
314
+    ],
315
+    [
316
+        (0, 0, 0),
317
+        (0, 0, 0),
318
+        (0, 0, 0),
319
+        (0, 0, 0),
320
+        (0, 0, 0),
321
+        (0, 0, 0),
322
+        (0, 0, 0),
323
+        (0, 0, 0),
324
+        (255, 255, 255),
325
+        (0, 0, 0),
326
+        (255, 255, 255),
327
+        (255, 255, 255),
328
+        (0, 0, 0),
329
+        (255, 255, 255),
330
+        (0, 0, 0),
331
+        (0, 0, 0),
332
+        (0, 0, 0),
333
+        (0, 0, 0),
334
+        (255, 255, 255),
335
+        (255, 255, 255),
336
+        (0, 0, 0),
337
+    ],
338
+    [
339
+        (255, 255, 255),
340
+        (255, 255, 255),
341
+        (255, 255, 255),
342
+        (255, 255, 255),
343
+        (255, 255, 255),
344
+        (255, 255, 255),
345
+        (255, 255, 255),
346
+        (0, 0, 0),
347
+        (0, 0, 0),
348
+        (255, 255, 255),
349
+        (255, 255, 255),
350
+        (255, 255, 255),
351
+        (0, 0, 0),
352
+        (0, 0, 0),
353
+        (0, 0, 0),
354
+        (255, 255, 255),
355
+        (255, 255, 255),
356
+        (0, 0, 0),
357
+        (255, 255, 255),
358
+        (255, 255, 255),
359
+        (255, 255, 255),
360
+    ],
361
+    [
362
+        (255, 255, 255),
363
+        (0, 0, 0),
364
+        (0, 0, 0),
365
+        (0, 0, 0),
366
+        (0, 0, 0),
367
+        (0, 0, 0),
368
+        (255, 255, 255),
369
+        (0, 0, 0),
370
+        (0, 0, 0),
371
+        (0, 0, 0),
372
+        (0, 0, 0),
373
+        (255, 255, 255),
374
+        (255, 255, 255),
375
+        (0, 0, 0),
376
+        (0, 0, 0),
377
+        (255, 255, 255),
378
+        (0, 0, 0),
379
+        (0, 0, 0),
380
+        (0, 0, 0),
381
+        (0, 0, 0),
382
+        (255, 255, 255),
383
+    ],
384
+    [
385
+        (255, 255, 255),
386
+        (0, 0, 0),
387
+        (255, 255, 255),
388
+        (255, 255, 255),
389
+        (255, 255, 255),
390
+        (0, 0, 0),
391
+        (255, 255, 255),
392
+        (0, 0, 0),
393
+        (255, 255, 255),
394
+        (255, 255, 255),
395
+        (255, 255, 255),
396
+        (255, 255, 255),
397
+        (0, 0, 0),
398
+        (0, 0, 0),
399
+        (0, 0, 0),
400
+        (0, 0, 0),
401
+        (255, 255, 255),
402
+        (0, 0, 0),
403
+        (0, 0, 0),
404
+        (0, 0, 0),
405
+        (0, 0, 0),
406
+    ],
407
+    [
408
+        (255, 255, 255),
409
+        (0, 0, 0),
410
+        (255, 255, 255),
411
+        (255, 255, 255),
412
+        (255, 255, 255),
413
+        (0, 0, 0),
414
+        (255, 255, 255),
415
+        (0, 0, 0),
416
+        (0, 0, 0),
417
+        (255, 255, 255),
418
+        (255, 255, 255),
419
+        (255, 255, 255),
420
+        (0, 0, 0),
421
+        (0, 0, 0),
422
+        (255, 255, 255),
423
+        (255, 255, 255),
424
+        (255, 255, 255),
425
+        (0, 0, 0),
426
+        (255, 255, 255),
427
+        (255, 255, 255),
428
+        (0, 0, 0),
429
+    ],
430
+    [
431
+        (255, 255, 255),
432
+        (0, 0, 0),
433
+        (255, 255, 255),
434
+        (255, 255, 255),
435
+        (255, 255, 255),
436
+        (0, 0, 0),
437
+        (255, 255, 255),
438
+        (0, 0, 0),
439
+        (255, 255, 255),
440
+        (0, 0, 0),
441
+        (255, 255, 255),
442
+        (0, 0, 0),
443
+        (255, 255, 255),
444
+        (0, 0, 0),
445
+        (255, 255, 255),
446
+        (0, 0, 0),
447
+        (255, 255, 255),
448
+        (0, 0, 0),
449
+        (255, 255, 255),
450
+        (0, 0, 0),
451
+        (255, 255, 255),
452
+    ],
453
+    [
454
+        (255, 255, 255),
455
+        (0, 0, 0),
456
+        (0, 0, 0),
457
+        (0, 0, 0),
458
+        (0, 0, 0),
459
+        (0, 0, 0),
460
+        (255, 255, 255),
461
+        (0, 0, 0),
462
+        (0, 0, 0),
463
+        (0, 0, 0),
464
+        (255, 255, 255),
465
+        (255, 255, 255),
466
+        (0, 0, 0),
467
+        (0, 0, 0),
468
+        (0, 0, 0),
469
+        (0, 0, 0),
470
+        (255, 255, 255),
471
+        (0, 0, 0),
472
+        (0, 0, 0),
473
+        (255, 255, 255),
474
+        (0, 0, 0),
475
+    ],
476
+    [
477
+        (255, 255, 255),
478
+        (255, 255, 255),
479
+        (255, 255, 255),
480
+        (255, 255, 255),
481
+        (255, 255, 255),
482
+        (255, 255, 255),
483
+        (255, 255, 255),
484
+        (0, 0, 0),
485
+        (255, 255, 255),
486
+        (255, 255, 255),
487
+        (0, 0, 0),
488
+        (255, 255, 255),
489
+        (255, 255, 255),
490
+        (0, 0, 0),
491
+        (0, 0, 0),
492
+        (255, 255, 255),
493
+        (0, 0, 0),
494
+        (0, 0, 0),
495
+        (0, 0, 0),
496
+        (255, 255, 255),
497
+        (255, 255, 255),
498
+    ],
499
+]
500
+
501
+if True:#__name__ == "__main__":
502
+    from solid import Solid
503
+    from life import GameOfLife
504
+    from net import CheckHTTP
505
+    from qr import QRScreen
506
+    from scroll import ScrollText
507
+    from manager import Manager
508
+
509
+    import util
510
+    t = util.getTarget()
511
+
512
+    # Main "Menu"
513
+    m = Manager(t)
514
+    m.add(ScrollText(t, "#CCCAMP23", "bitmap8", 1, 10, camp_green))
515
+    m.add(Solid(t, 1.0))
516
+    #m.add(QRScreen(t, qr_data, 30.0, "Drinks:", "bitmap8", (255, 255, 255), (0, 0, 0)))
517
+    #m.add(Solid(t, 1.0))
518
+
519
+    m.restart()
520
+    t.loop(m.draw)

+ 4
- 0
copy.sh Bestand weergeven

@@ -11,6 +11,8 @@ cp solid.py /pyboard
11 11
 cp splash.py /pyboard
12 12
 cp life.py /pyboard
13 13
 cp qr.py /pyboard
14
+cp camp_pico.py /pyboard
15
+cp scroll.py /pyboard
14 16
 cp $1 /pyboard/main.py
15 17
 EOF
16 18
 else
@@ -25,5 +27,7 @@ cp solid.py /pyboard
25 27
 cp splash.py /pyboard
26 28
 cp life.py /pyboard
27 29
 cp qr.py /pyboard
30
+cp camp_pico.py /pyboard
31
+cp scroll.py /pyboard
28 32
 EOF
29 33
 fi

+ 16
- 4
pico.py Bestand weergeven

@@ -69,18 +69,30 @@ class PicoText:
69 69
         self.color = c
70 70
 
71 71
     def text(self, s, f, offset = 0, earlyAbort = True, yOff = 0, compat = True):
72
+        if not earlyAbort:
73
+            return self.gui.matrix.display.measure_text(s, scale=1)
74
+
72 75
         pen = self.gui.matrix.display.create_pen(self.fg[0], self.fg[1], self.fg[2])
73 76
         self.gui.matrix.display.set_pen(pen)
74 77
 
75 78
         self.gui.matrix.display.set_font(f)
76 79
 
77 80
         if not compat:
78
-            x = 0
81
+            # absolute positioning
82
+            x = offset
79 83
             y = yOff
80 84
         else:
81
-            # TODO
82
-            x = 0
83
-            y = int(self.gui.height / 2 - 4 + yOff)
85
+            # centered, like BDF DrawText implementation
86
+            fontOff = 0
87
+            if f == "bitmap6":
88
+                fontOff = 3
89
+            elif f == "bitmap8":
90
+                fontOff = 4
91
+            elif f == "bitmap14_outline":
92
+                fontOff = 7
93
+
94
+            x = -offset
95
+            y = int(self.gui.height / 2 - fontOff + yOff)
84 96
 
85 97
         self.gui.matrix.display.text(s, x, y, scale=1)
86 98
 

+ 50
- 19
qr.py Bestand weergeven

@@ -14,36 +14,50 @@ import time
14 14
 import qrcode
15 15
 import util
16 16
 
17
+class PicoImage():
18
+    def getpixel(self, xy):
19
+        x, y = xy
20
+        return self.data[y][x]
21
+
17 22
 class QRScreen:
18 23
     def __init__(self, g, d, t = 10.0, h = None, f = None, c1 = (0, 0, 0), c2 = (255, 255, 255)):
19 24
         self.gui = g
25
+        self.data = d
20 26
         self.time = t
21 27
         self.heading = h
22 28
         self.font = f
23 29
         self.c1 = c1
24 30
         self.c2 = c2
25 31
 
26
-        qr = qrcode.QRCode(
27
-            box_size = 1,
28
-            border = 0,
29
-        )
30
-        qr.add_data(d)
31
-        qr.make(fit = True)
32
-
33
-        if util.isPi():
34
-            # work-around for weird bug in old qrcode lib?
35
-            if (self.c1 == (0, 0, 0)) and (self.c2 == (255, 255, 255)):
36
-                self.image = qr.make_image(fill_color = "black", back_color = "white")
37
-                self.c1 = (0, 0, 0)
38
-                self.c2 = (255, 255, 255)
39
-            elif (self.c1 == (255, 255, 255)) and (self.c2 == (0, 0, 0)):
40
-                self.image = qr.make_image(fill_color = "white", back_color = "black")
41
-                self.c1 = (255, 255, 255)
42
-                self.c2 = (0, 0, 0)
32
+        if isinstance(self.data, str):
33
+            # Generate QR code with library
34
+            qr = qrcode.QRCode(
35
+                box_size = 1,
36
+                border = 0,
37
+            )
38
+            qr.add_data(self.data)
39
+            qr.make(fit = True)
40
+
41
+            if util.isPi():
42
+                # work-around for weird bug in old qrcode lib?
43
+                if (self.c1 == (0, 0, 0)) and (self.c2 == (255, 255, 255)):
44
+                    self.image = qr.make_image(fill_color = "black", back_color = "white")
45
+                    self.c1 = (0, 0, 0)
46
+                    self.c2 = (255, 255, 255)
47
+                elif (self.c1 == (255, 255, 255)) and (self.c2 == (0, 0, 0)):
48
+                    self.image = qr.make_image(fill_color = "white", back_color = "black")
49
+                    self.c1 = (255, 255, 255)
50
+                    self.c2 = (0, 0, 0)
51
+                else:
52
+                    raise RuntimeError("QR colors other than black/white not supported on Pi")
43 53
             else:
44
-                raise RuntimeError("QR colors other than black/white not supported on Pi")
54
+                self.image = qr.make_image(fill_color = self.c1, back_color = self.c2)
45 55
         else:
46
-            self.image = qr.make_image(fill_color = self.c1, back_color = self.c2)
56
+            # Show pre-generated QR code image
57
+            self.image = PicoImage()
58
+            self.image.height = len(self.data)
59
+            self.image.width = len(self.data[0])
60
+            self.image.data = self.data
47 61
 
48 62
         if self.heading != None:
49 63
             DrawText = util.getTextDrawer()
@@ -88,7 +102,24 @@ class QRScreen:
88 102
 
89 103
 if __name__ == "__main__":
90 104
     import util
105
+    import os
106
+
91 107
     t = util.getTarget()
92 108
 
93 109
     d = QRScreen(t, "Hello World", 10.0, "Drinks:", "tom-thumb", (255, 255, 255), (0, 0, 0))
110
+
111
+    # dump generated QR image to console, for embedding in Pico script
112
+    print("Dumping QR image to qr_tmp.txt")
113
+    with open("qr_tmp.txt", "w") as f:
114
+        f.write("# QR code image for \"" + d.data + "\"" + os.linesep)
115
+        f.write("# size:" + str(d.image.width) + "x" + str(d.image.height) + os.linesep)
116
+        f.write("qr_data = [" + os.linesep)
117
+        for y in range(0, d.image.height):
118
+            f.write("    [" + os.linesep)
119
+            for x in range(0, d.image.width):
120
+                s = str(d.image.getpixel((x, y)))
121
+                f.write("        " + s + "," + os.linesep)
122
+            f.write("    ]," + os.linesep)
123
+        f.write("]" + os.linesep)
124
+
94 125
     t.loop(d.draw)

+ 2
- 1
scroll.py Bestand weergeven

@@ -13,7 +13,6 @@
13 13
 # think this stuff is worth it, you can buy me a beer in return.   Thomas Buck
14 14
 # ----------------------------------------------------------------------------
15 15
 
16
-from PIL import Image
17 16
 import os
18 17
 import time
19 18
 import util
@@ -34,6 +33,7 @@ class ScrollText:
34 33
         self.text = t
35 34
         self.font = f
36 35
         self.width = self.drawer.text(self.text, self.font, 0, False)
36
+        print(self.text, self.font, self.width)
37 37
 
38 38
     def restart(self):
39 39
         self.offset = -self.gui.width
@@ -46,6 +46,7 @@ class ScrollText:
46 46
     def draw(self):
47 47
         if (time.time() - self.last) > self.speed:
48 48
             off = (time.time() - self.last) / self.speed
49
+            print(self.offset, "->", self.offset + int(off))
49 50
             self.offset += int(off)
50 51
             self.last = time.time()
51 52
             if self.offset >= self.width:

Laden…
Annuleren
Opslaan