@@ -11,34 +11,30 @@ main:
1111 // This example is setup to work with the RH2 device
1212 device := devices .RtkHandheld2
1313
14- print "💬 Sending bitmap logo to device screen"
1514 page := ( random 10 255 )
16-
17- print "📷 Drawing 40x40 logo at (0,0) top left"
18- device .comms .send ( messages .DrawElement .msg
19- --data = ( messages .DrawElement .data
20- --page-id = page
21- --status-bar-enable = false
22- --redraw-type = messages .DrawElement .REDRAW-TYPE_CLEARDONTDRAW
23- --x = 0
24- --y = 0
25- --width = 40
26- --height = 40
27- --type = messages .DrawElement .TYPE_BITMAP
28- --bitmap = lightbug-40-40 ) )
15+ screen-width := 250
16+ screen-height := 122
17+ bitmap-dimension := 40
18+ positions := [
19+ [ messages .DrawElement .REDRAW-TYPE_CLEARDONTDRAW , 0 , 0 ] , // Top left
20+ [ messages .DrawElement .REDRAW-TYPE_BUFFERONLY , ( screen-width - 1 - bitmap-dimension ) , 0 ] , // Top right
21+ [ messages .DrawElement .REDRAW-TYPE_BUFFERONLY , 0 , ( screen-height - 1 - bitmap-dimension ) ] , // Bottom left
22+ [ messages .DrawElement .REDRAW-TYPE_FULLREDRAWWITHOUTCLEAR , ( screen-width - 1 - bitmap-dimension ) , ( screen-height - 1 - bitmap-dimension ) ] , // Bottom right
23+ ]
2924
30- print "📷 Drawing a second 40x40 logo at (210,0) top right"
31- device .comms .send ( messages .DrawElement .msg
32- --data = ( messages .DrawElement .data
33- --page-id = page
34- --status-bar-enable = false
35- --redraw-type = messages .DrawElement .REDRAW-TYPE_FULLREDRAW
36- --x = 209
37- --y = 0
38- --width = 40
39- --height = 40
40- --type = messages .DrawElement .TYPE_BITMAP
41- --bitmap = lightbug-40-40 ) )
25+ print "💬 Sending bitmap logos to device screen"
26+ positions .do : | p |
27+ device .comms .send ( messages .DrawElement .msg
28+ --data = ( messages .DrawElement .data
29+ --page-id = page
30+ --status-bar-enable = false
31+ --redraw-type = p [ 0 ]
32+ --x = p [ 1 ]
33+ --y = p [ 2 ]
34+ --width = bitmap-dimension
35+ --height = bitmap-dimension
36+ --type = messages .DrawElement .TYPE_BITMAP
37+ --bitmap = lightbug-40-40 ) )
4238
4339 // Continue running to keep the app alive
4440 while true :
0 commit comments