pxt-common-packages 9.4.6 → 9.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/common-sim.d.ts +2 -2
- package/built/common-sim.js +12 -1
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +9043 -7832
- package/libs/controller---none/built/debug/binary.js +9020 -7809
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/game/_locales/game-strings.json +21 -0
- package/libs/game/built/debug/binary.js +8935 -7724
- package/libs/game/hitbox.ts +40 -22
- package/libs/game/sprite.ts +244 -16
- package/libs/game/spritesay.ts +2 -2
- package/libs/lcd/built/debug/binary.js +8 -8
- package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
- package/libs/lora/built/debug/binary.js +8 -8
- package/libs/matrix-keypad/built/debug/binary.js +8 -8
- package/libs/mqtt/built/debug/binary.js +176 -176
- package/libs/net/built/debug/binary.js +176 -176
- package/libs/net-game/built/debug/binary.js +10832 -9617
- package/libs/palette/built/debug/binary.js +8934 -7723
- package/libs/pixel/built/debug/binary.js +8 -8
- package/libs/power/built/debug/binary.js +8 -8
- package/libs/proximity/built/debug/binary.js +9 -9
- package/libs/radio/built/debug/binary.js +8 -8
- package/libs/radio-broadcast/built/debug/binary.js +8 -8
- package/libs/rotary-encoder/built/debug/binary.js +8 -8
- package/libs/screen/built/debug/binary.js +50 -50
- package/libs/screen/image.cpp +14 -4
- package/libs/screen/image.ts +5 -4
- package/libs/screen/sim/image.ts +15 -3
- package/libs/servo/built/debug/binary.js +8 -8
- package/libs/sprite-scaling/README.md +3 -0
- package/libs/sprite-scaling/_locales/sprite-scaling-jsdoc-strings.json +1 -0
- package/libs/sprite-scaling/_locales/sprite-scaling-strings.json +9 -0
- package/libs/sprite-scaling/built/debug/binary.js +40047 -0
- package/libs/sprite-scaling/pxt.json +16 -0
- package/libs/sprite-scaling/scaling.ts +111 -0
- package/libs/sprite-scaling/targetoverrides.ts +1 -0
- package/libs/sprite-scaling/test.ts +0 -0
- package/libs/storyboard/built/debug/binary.js +8934 -7723
- package/package.json +1 -1
package/libs/screen/sim/image.ts
CHANGED
|
@@ -639,11 +639,11 @@ namespace pxsim.ImageMethods {
|
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
-
export function _blit(img: RefImage, src: RefImage, args: RefCollection) {
|
|
643
|
-
blit(img, src, args);
|
|
642
|
+
export function _blit(img: RefImage, src: RefImage, args: RefCollection): boolean {
|
|
643
|
+
return blit(img, src, args);
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
-
export function blit(dst: RefImage, src: RefImage, args: RefCollection) {
|
|
646
|
+
export function blit(dst: RefImage, src: RefImage, args: RefCollection): boolean {
|
|
647
647
|
const xDst = args.getAt(0) as number;
|
|
648
648
|
const yDst = args.getAt(1) as number;
|
|
649
649
|
const wDst = args.getAt(2) as number;
|
|
@@ -653,6 +653,7 @@ namespace pxsim.ImageMethods {
|
|
|
653
653
|
const wSrc = args.getAt(6) as number;
|
|
654
654
|
const hSrc = args.getAt(7) as number;
|
|
655
655
|
const transparent = args.getAt(8) as number;
|
|
656
|
+
const check = args.getAt(9) as number;
|
|
656
657
|
|
|
657
658
|
const xSrcStep = ((wSrc << 16) / wDst) | 0;
|
|
658
659
|
const ySrcStep = ((hSrc << 16) / hDst) | 0;
|
|
@@ -669,16 +670,27 @@ namespace pxsim.ImageMethods {
|
|
|
669
670
|
const xSrcEnd = Math.min(src._width, xSrc + wSrc) << 16;
|
|
670
671
|
const ySrcEnd = Math.min(src._height, ySrc + hSrc) << 16;
|
|
671
672
|
|
|
673
|
+
if (!check)
|
|
674
|
+
dst.makeWritable();
|
|
675
|
+
|
|
672
676
|
for (let yDstCur = yDstStart, ySrcCur = ySrcStart; yDstCur < yDstEnd && ySrcCur < ySrcEnd; ++yDstCur, ySrcCur += ySrcStep) {
|
|
673
677
|
const ySrcCurI = ySrcCur >> 16;
|
|
674
678
|
for (let xDstCur = xDstStart, xSrcCur = xSrcStart; xDstCur < xDstEnd && xSrcCur < xSrcEnd; ++xDstCur, xSrcCur += xSrcStep) {
|
|
675
679
|
const xSrcCurI = xSrcCur >> 16;
|
|
676
680
|
const cSrc = getPixel(src, xSrcCurI, ySrcCurI);
|
|
681
|
+
if (check && cSrc) {
|
|
682
|
+
const cDst = getPixel(dst, xDstCur, yDstCur);
|
|
683
|
+
if (cDst) {
|
|
684
|
+
return true;
|
|
685
|
+
}
|
|
686
|
+
continue;
|
|
687
|
+
}
|
|
677
688
|
if (!transparent || cSrc) {
|
|
678
689
|
setPixel(dst, xDstCur, yDstCur, cSrc);
|
|
679
690
|
}
|
|
680
691
|
}
|
|
681
692
|
}
|
|
693
|
+
return false;
|
|
682
694
|
}
|
|
683
695
|
}
|
|
684
696
|
|
|
@@ -56,7 +56,7 @@ const pxsim_pxtrt = pxsim.pxtrt;
|
|
|
56
56
|
const pxsim_numops = pxsim.numops;
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function _main___P52708(s) {
|
|
60
60
|
let r0 = s.r0, step = s.pc;
|
|
61
61
|
s.pc = -1;
|
|
62
62
|
|
|
@@ -66,19 +66,19 @@ if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) re
|
|
|
66
66
|
switch (step) {
|
|
67
67
|
case 0:
|
|
68
68
|
|
|
69
|
-
globals.
|
|
70
|
-
globals.
|
|
69
|
+
globals._intervals___52949 = (undefined);
|
|
70
|
+
globals._pollEventQueue___52962 = (undefined);
|
|
71
71
|
r0 = undefined;
|
|
72
72
|
return leave(s, r0)
|
|
73
73
|
default: oops()
|
|
74
74
|
} } }
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
_main___P52708.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"targetoverrides.ts","functionName":"<main>","argumentNames":[]}
|
|
76
|
+
_main___P52708.continuations = [ ]
|
|
77
77
|
|
|
78
|
-
function
|
|
78
|
+
function _main___P52708_mk(s) {
|
|
79
79
|
checkStack(s.depth);
|
|
80
80
|
return {
|
|
81
|
-
parent: s, fn:
|
|
81
|
+
parent: s, fn: _main___P52708, depth: s.depth + 1,
|
|
82
82
|
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
|
|
83
83
|
} }
|
|
84
84
|
|
|
@@ -88,5 +88,5 @@ function _main___P52380_mk(s) {
|
|
|
88
88
|
|
|
89
89
|
const breakpoints = setupDebugger(1, [])
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return _main___P52708
|
|
92
92
|
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sprites.growByPercent|block": "grow $sprite=variables_get(mySprite) by $amount percent || $direction anchor $anchor",
|
|
3
|
+
"sprites.growByPixels|block": "grow $sprite=variables_get(mySprite) by $amount pixels $direction || anchor $anchor proportional $proportional",
|
|
4
|
+
"sprites.setScale|block": "set $sprite=variables_get(mySprite) scale to $value || $direction anchor $anchor",
|
|
5
|
+
"sprites.shrinkByPercent|block": "shrink $sprite=variables_get(mySprite) by $amount percent || $direction anchor $anchor",
|
|
6
|
+
"sprites.shrinkByPixels|block": "shrink $sprite=variables_get(mySprite) by $amount pixels $direction || anchor $anchor proportional $proportional",
|
|
7
|
+
"{id:category}Sprites": "Sprites",
|
|
8
|
+
"{id:group}Scale": "Scale"
|
|
9
|
+
}
|