pxt-common-packages 9.4.9 → 9.4.10
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/libs/controller/built/debug/binary.js +1 -1
- package/libs/controller---none/built/debug/binary.js +1 -1
- package/libs/game/built/debug/binary.js +1 -1
- package/libs/game/sprite.ts +4 -4
- package/libs/net-game/built/debug/binary.js +1 -1
- package/libs/palette/built/debug/binary.js +1 -1
- package/libs/sprite-scaling/_locales/sprite-scaling-strings.json +4 -5
- package/libs/sprite-scaling/built/debug/binary.js +3001 -3001
- package/libs/sprite-scaling/scaling.ts +50 -41
- package/libs/storyboard/built/debug/binary.js +1 -1
- package/package.json +1 -1
|
@@ -35097,7 +35097,7 @@ switch (step) {
|
|
|
35097
35097
|
return leave(s, r0)
|
|
35098
35098
|
default: oops()
|
|
35099
35099
|
} } }
|
|
35100
|
-
Sprite_toString__P65810.info = {"start":
|
|
35100
|
+
Sprite_toString__P65810.info = {"start":37672,"length":93,"line":1169,"column":4,"endLine":1171,"endColumn":5,"fileName":"pxt_modules/game/sprite.ts","functionName":"toString","argumentNames":["this"]}
|
|
35101
35101
|
|
|
35102
35102
|
function Sprite_toString__P65810_mk(s) {
|
|
35103
35103
|
checkStack(s.depth);
|
|
@@ -34988,7 +34988,7 @@ switch (step) {
|
|
|
34988
34988
|
return leave(s, r0)
|
|
34989
34989
|
default: oops()
|
|
34990
34990
|
} } }
|
|
34991
|
-
Sprite_toString__P81178.info = {"start":
|
|
34991
|
+
Sprite_toString__P81178.info = {"start":37672,"length":93,"line":1169,"column":4,"endLine":1171,"endColumn":5,"fileName":"pxt_modules/game/sprite.ts","functionName":"toString","argumentNames":["this"]}
|
|
34992
34992
|
|
|
34993
34993
|
function Sprite_toString__P81178_mk(s) {
|
|
34994
34994
|
checkStack(s.depth);
|
|
@@ -34518,7 +34518,7 @@ switch (step) {
|
|
|
34518
34518
|
return leave(s, r0)
|
|
34519
34519
|
default: oops()
|
|
34520
34520
|
} } }
|
|
34521
|
-
Sprite_toString__P138488.info = {"start":
|
|
34521
|
+
Sprite_toString__P138488.info = {"start":37672,"length":93,"line":1169,"column":4,"endLine":1171,"endColumn":5,"fileName":"sprite.ts","functionName":"toString","argumentNames":["this"]}
|
|
34522
34522
|
|
|
34523
34523
|
function Sprite_toString__P138488_mk(s) {
|
|
34524
34524
|
checkStack(s.depth);
|
package/libs/game/sprite.ts
CHANGED
|
@@ -1112,14 +1112,14 @@ class Sprite extends sprites.BaseSprite {
|
|
|
1112
1112
|
if (anchor & (ScaleAnchor.Left | ScaleAnchor.Right)) {
|
|
1113
1113
|
const newW = this.width;
|
|
1114
1114
|
const diff = newW - oldW;
|
|
1115
|
-
const diffOver2 =
|
|
1115
|
+
const diffOver2 = diff / 2;
|
|
1116
1116
|
if (anchor & ScaleAnchor.Left) { this.x += diffOver2; }
|
|
1117
1117
|
if (anchor & ScaleAnchor.Right) { this.x -= diffOver2; }
|
|
1118
1118
|
}
|
|
1119
1119
|
if (anchor & (ScaleAnchor.Top | ScaleAnchor.Bottom)) {
|
|
1120
1120
|
const newH = this.height;
|
|
1121
1121
|
const diff = newH - oldH;
|
|
1122
|
-
const diffOver2 =
|
|
1122
|
+
const diffOver2 = diff / 2;
|
|
1123
1123
|
if (anchor & ScaleAnchor.Top) { this.y += diffOver2; }
|
|
1124
1124
|
if (anchor & ScaleAnchor.Bottom) { this.y -= diffOver2; }
|
|
1125
1125
|
}
|
|
@@ -1131,7 +1131,7 @@ class Sprite extends sprites.BaseSprite {
|
|
|
1131
1131
|
//% inlineInputMode=inline
|
|
1132
1132
|
//% value.defl=1
|
|
1133
1133
|
//% anchor.defl=ScaleAnchor.Middle
|
|
1134
|
-
//% help=sprites/sprite/
|
|
1134
|
+
//% help=sprites/sprite/scale
|
|
1135
1135
|
//% group="Scale" weight=90
|
|
1136
1136
|
setScale(value: number, anchor?: ScaleAnchor): void {
|
|
1137
1137
|
const direction = ScaleDirection.Uniformly;
|
|
@@ -1152,7 +1152,7 @@ class Sprite extends sprites.BaseSprite {
|
|
|
1152
1152
|
//% inlineInputMode=inline
|
|
1153
1153
|
//% value.defl=1
|
|
1154
1154
|
//% anchor.defl=ScaleAnchor.Middle
|
|
1155
|
-
//% help=sprites/sprite/
|
|
1155
|
+
//% help=sprites/sprite/scale
|
|
1156
1156
|
//% group="Scale" weight=90
|
|
1157
1157
|
changeScale(value: number, anchor?: ScaleAnchor): void {
|
|
1158
1158
|
const direction = ScaleDirection.Uniformly;
|
|
@@ -43801,7 +43801,7 @@ switch (step) {
|
|
|
43801
43801
|
return leave(s, r0)
|
|
43802
43802
|
default: oops()
|
|
43803
43803
|
} } }
|
|
43804
|
-
Sprite_toString__P111975.info = {"start":
|
|
43804
|
+
Sprite_toString__P111975.info = {"start":37672,"length":93,"line":1169,"column":4,"endLine":1171,"endColumn":5,"fileName":"pxt_modules/game/sprite.ts","functionName":"toString","argumentNames":["this"]}
|
|
43805
43805
|
|
|
43806
43806
|
function Sprite_toString__P111975_mk(s) {
|
|
43807
43807
|
checkStack(s.depth);
|
|
@@ -34518,7 +34518,7 @@ switch (step) {
|
|
|
34518
34518
|
return leave(s, r0)
|
|
34519
34519
|
default: oops()
|
|
34520
34520
|
} } }
|
|
34521
|
-
Sprite_toString__P170429.info = {"start":
|
|
34521
|
+
Sprite_toString__P170429.info = {"start":37672,"length":93,"line":1169,"column":4,"endLine":1171,"endColumn":5,"fileName":"pxt_modules/game/sprite.ts","functionName":"toString","argumentNames":["this"]}
|
|
34522
34522
|
|
|
34523
34523
|
function Sprite_toString__P170429_mk(s) {
|
|
34524
34524
|
checkStack(s.depth);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scaling.
|
|
3
|
-
"scaling.
|
|
4
|
-
"scaling.
|
|
5
|
-
"scaling.
|
|
6
|
-
"scaling.shrinkByPixels|block": "shrink $sprite=variables_get(mySprite) by $amount pixels $direction || anchor $anchor proportional $proportional",
|
|
2
|
+
"scaling.scaleByPercent|block": "change $sprite=variables_get(mySprite) scale by $value percent $direction anchor $anchor",
|
|
3
|
+
"scaling.scaleByPixels|block": "change $sprite=variables_get(mySprite) scale by $value pixels $direction anchor $anchor || proportional $proportional",
|
|
4
|
+
"scaling.scaleToPercent|block": "set $sprite=variables_get(mySprite) scale to $value percent $direction anchor $anchor",
|
|
5
|
+
"scaling.scaleToPixels|block": "set $sprite=variables_get(mySprite) scale to $value pixels $direction anchor $anchor || proportional $proportional",
|
|
7
6
|
"{id:category}Scaling": "Scaling"
|
|
8
7
|
}
|