forked from microbit-apps/pxt-arcadeshield
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitmap.ts
47 lines (43 loc) · 1.17 KB
/
bitmap.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* Get the screen bitmap
*/
//% blockNamespace="drawing" group="Create"
//% blockId=theScreen block="screen"
//% help=github:pxt-arcadeshield/docs/screen-image
function screen(): Bitmap {
return theScreen;
}
namespace bitmaps {
/**
* Returns the width of a bitmap
*
* @param bitmap The bitmap to get the width of
* @returns
*/
//% blockId=bitmap_width
//% group="Create"
//% blockNamespace="drawing"
//% block="$bitmap width"
//% bitmap.shadow=variables_get
//% bitmap.defl=bitmap
//% weight=30
export function width(bitmap: Bitmap) {
return bitmap.width;
}
/**
* Returns the height of a bitmap
*
* @param bitmap The bitmap to get the height of
* @returns
*/
//% blockId=bitmap_height
//% group="Create"
//% blockNamespace="drawing"
//% block="$bitmap height"
//% bitmap.shadow=variables_get
//% bitmap.defl=bitmap
//% weight=30
export function height(bitmap: Bitmap) {
return bitmap.height;
}
}