File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ namespace user_interface_base {
1111
1212 export class Screen {
1313 private static image_ : Bitmap
14+ private static bitmapCache : Bitmap [ ] = [ ] ;
1415
1516 public static WIDTH = screen ( ) . width
1617 public static HEIGHT = screen ( ) . height
@@ -132,14 +133,20 @@ namespace user_interface_base {
132133
133134 this . waitForAck ( ) ;
134135 }
136+ this . bitmapCache . push ( bitmap ) ;
135137 }
136138
137139
138140 public static drawTransparentImage ( from : Bitmap , x : number , y : number ) {
139- const hash = 0 ;
140-
141- // TODO
141+ let index = 0 ;
142142
143+ for ( let i = 0 ; i < this . bitmapCache . length ; i ++ ) {
144+ if ( this . bitmapCache [ i ] == from ) {
145+ index = i ;
146+ break ;
147+ }
148+ }
149+ basic . showNumber ( index ) ;
143150 radio . sendBuffer ( Buffer . fromArray ( [ SCREEN_FN_ID_DRAW_TRANSPARENT_IMAGE , 7 , x , y ] ) ) ;
144151 this . waitForAck ( ) ;
145152 }
You can’t perform that action at this time.
0 commit comments