Skip to content

Commit

Permalink
update shims
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Oct 9, 2024
1 parent 4e8b20b commit 2825a6a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions libs/arcadeshield/_locales/arcadeshield-jsdoc-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Bitmap.setRows": "Copy row(s) of pixel from buffer to bitmap.",
"Bitmap.transposed": "Returns a transposed bitmap (with X/Y swapped)",
"Bitmap.width": "Get the width of the bitmap",
"bitmap.create": "Create new empty (transparent) bitmap",
"bitmap.doubledIcon": "Double the size of an icon",
"bitmap.ofBuffer": "Create new bitmap with given content"
"bitmaps.create": "Create new empty (transparent) bitmap",
"bitmaps.doubledIcon": "Double the size of an icon",
"bitmaps.ofBuffer": "Create new bitmap with given content"
}
3 changes: 2 additions & 1 deletion libs/arcadeshield/_locales/arcadeshield-strings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"bitmap|block": "bitmap",
"bitmaps|block": "bitmaps",
"{id:category}Bitmap": "Bitmap",
"{id:category}Bitmaps": "Bitmaps",
"{id:category}__screenhelpers": "__screenhelpers"
}
14 changes: 10 additions & 4 deletions libs/arcadeshield/shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@


declare interface Bitmap {
/**
* Get underlying buffer
*/
//% property shim=BitmapMethods::__buffer
__buffer: Buffer;

/**
* Get the width of the bitmap
*/
Expand Down Expand Up @@ -129,24 +135,24 @@ declare interface Bitmap {
//% shim=BitmapMethods::overlapsWith
overlapsWith(other: Bitmap, x: int32, y: int32): boolean;
}
declare namespace bitmap {
declare namespace bitmaps {

/**
* Create new bitmap with given content
*/
//% shim=bitmap::ofBuffer
//% shim=bitmaps::ofBuffer
function ofBuffer(buf: Buffer): Bitmap;

/**
* Create new empty (transparent) bitmap
*/
//% shim=bitmap::create
//% shim=bitmaps::create
function create(width: int32, height: int32): Bitmap;

/**
* Double the size of an icon
*/
//% shim=bitmap::doubledIcon
//% shim=bitmaps::doubledIcon
function doubledIcon(icon: Buffer): Buffer;
}

Expand Down

0 comments on commit 2825a6a

Please sign in to comment.