pxt-common-packages 10.4.3 → 10.4.5
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 +14 -0
- package/built/common-sim.js +98 -0
- package/libs/azureiot/built/debug/binary.js +461 -461
- package/libs/color/built/debug/binary.js +8 -8
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/get-tile.md +3 -3
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/get-tiles-by-type.md +65 -0
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/on-hit-tile.md +4 -4
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/place-on-random-tile.md +61 -0
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/place.md +2 -6
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/set-tile-at.md +61 -0
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/set-tile-map.md +3 -3
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/set-tile.md +1 -1
- package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/tile-map.md +2 -2
- package/libs/{game/docs/types → color-coded-tilemap/docs/reference/color-coded-tilemap}/tile.md +9 -5
- package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap.md +32 -0
- package/libs/color-coded-tilemap/tilemap.ts +7 -7
- package/libs/color-sensor/built/debug/binary.js +8 -8
- package/libs/controller/built/debug/binary.js +7117 -7117
- package/libs/controller---none/built/debug/binary.js +7097 -7097
- package/libs/datalogger/built/debug/binary.js +63 -63
- package/libs/edge-connector/built/debug/binary.js +8 -8
- package/libs/edge-connector/docs/reference/edge-connector.md +5 -0
- package/libs/esp32/built/debug/binary.js +462 -462
- package/libs/feather/docs/reference/feather.md +11 -0
- package/libs/game/built/debug/binary.js +7036 -7036
- 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/mixer/instrument.ts +28 -9
- package/libs/mixer/melody.cpp +43 -0
- package/libs/mixer/melody.ts +4 -0
- package/libs/mixer/sequencer.ts +116 -0
- package/libs/mixer/sim/music.ts +102 -0
- 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 +8625 -8625
- package/libs/palette/built/debug/binary.js +7035 -7035
- 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 +8 -8
- 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/servo/built/debug/binary.js +8 -8
- package/libs/sprite-scaling/_locales/sprite-scaling-jsdoc-strings.json +18 -1
- package/libs/sprite-scaling/_locales/sprite-scaling-strings.json +1 -0
- package/libs/sprite-scaling/built/debug/binary.js +7035 -7035
- package/libs/sprite-scaling/docs/reference/sprite-scaling.md +23 -0
- package/libs/sprite-scaling/docs/reference/sprites/scaling/scale-by-pixels.md +1 -1
- package/libs/sprite-scaling/docs/reference/sprites/scaling/scale-to-pixels.md +1 -1
- package/libs/sprite-scaling/scaling.ts +24 -0
- package/libs/storyboard/built/debug/binary.js +7035 -7035
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Sprite Scaling
|
|
2
|
+
|
|
3
|
+
Scale sprites to expand or shrink their size.
|
|
4
|
+
|
|
5
|
+
## Scaling
|
|
6
|
+
|
|
7
|
+
```cards
|
|
8
|
+
scaling.scaleByPercent(null, 50, ScaleDirection.Uniformly, ScaleAnchor.Middle)
|
|
9
|
+
scaling.scaleByPixels(null, 1, ScaleDirection.Uniformly, ScaleAnchor.Middle)
|
|
10
|
+
scaling.scaleToPercent(null, 100, ScaleDirection.Uniformly, ScaleAnchor.Middle)
|
|
11
|
+
scaling.scaleToPixels(null, 1, ScaleDirection.Uniformly, ScaleAnchor.Middle)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## See also
|
|
15
|
+
|
|
16
|
+
[scale by percent](/reference/sprites/scaling/scale-by-pixels),
|
|
17
|
+
[scale by pixels](/reference/sprites/scaling/scale-by-percent),
|
|
18
|
+
[scale to pixels](/reference/sprites/scaling/scale-to-pixels),
|
|
19
|
+
[scale to percent](/reference/sprites/scaling/scale-to-percent)
|
|
20
|
+
|
|
21
|
+
```package
|
|
22
|
+
sprite-scaling
|
|
23
|
+
```
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
//% color="#95078E" weight=99 icon="\uf338"
|
|
2
2
|
namespace scaling {
|
|
3
|
+
/**
|
|
4
|
+
* Scale a sprite to a percentage of its original size.
|
|
5
|
+
* @param sprite to scale to a percentage of its original size
|
|
6
|
+
* @param value that is the percentage to scale the sprite, eg: 150
|
|
7
|
+
* @param direction from the sprite anchor point, eg: ScaleDirection.Uniformly
|
|
8
|
+
*/
|
|
3
9
|
//% blockId=sprite_scale_to_percent_ex
|
|
4
10
|
//% block="set $sprite=variables_get(mySprite) scale to $value percent $direction anchor $anchor"
|
|
5
11
|
//% expandableArgumentMode=enabled
|
|
@@ -22,6 +28,12 @@ namespace scaling {
|
|
|
22
28
|
sprite.setScaleCore(sx, sy, anchor);
|
|
23
29
|
}
|
|
24
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Scale a sprite by a percentage of its original size.
|
|
33
|
+
* @param sprite to scale to a percentage of its original size
|
|
34
|
+
* @param value that is the percentage to scale the sprite by, eg: 50
|
|
35
|
+
* @param direction from the sprite anchor point, eg: ScaleDirection.Uniformly
|
|
36
|
+
*/
|
|
25
37
|
//% blockId=sprite_scale_by_percent_ex
|
|
26
38
|
//% block="change $sprite=variables_get(mySprite) scale by $value percent $direction anchor $anchor"
|
|
27
39
|
//% expandableArgumentMode=enabled
|
|
@@ -44,6 +56,12 @@ namespace scaling {
|
|
|
44
56
|
sprite.setScaleCore(sx, sy, anchor);
|
|
45
57
|
}
|
|
46
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Scale a sprite to a number of pixels.
|
|
61
|
+
* @param sprite to scale to new pixel size
|
|
62
|
+
* @param value that is the number of pixels to scale the sprite to, eg: 32
|
|
63
|
+
* @param direction from the sprite anchor point, eg: ScaleDirection.Horizontally
|
|
64
|
+
*/
|
|
47
65
|
//% blockId=sprite_scale_to_pixels_ex
|
|
48
66
|
//% block="set $sprite=variables_get(mySprite) scale to $value pixels $direction anchor $anchor || proportional $proportional"
|
|
49
67
|
//% expandableArgumentMode=enabled
|
|
@@ -77,6 +95,12 @@ namespace scaling {
|
|
|
77
95
|
sprite.setScaleCore(sx, sy, anchor, proportional);
|
|
78
96
|
}
|
|
79
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Scale a sprite by a number of pixels.
|
|
100
|
+
* @param sprite to scale to new pixel size
|
|
101
|
+
* @param value that is the number of pixels to scale the sprite by, eg: 10
|
|
102
|
+
* @param direction from the sprite anchor point, eg: ScaleDirection.Horizontally
|
|
103
|
+
*/
|
|
80
104
|
//% blockId=sprite_scale_by_pixels_ex
|
|
81
105
|
//% block="change $sprite=variables_get(mySprite) scale by $value pixels $direction anchor $anchor || proportional $proportional"
|
|
82
106
|
//% expandableArgumentMode=enabled
|