pxt-common-packages 10.4.4 → 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.
Files changed (54) hide show
  1. package/built/common-sim.d.ts +14 -0
  2. package/built/common-sim.js +98 -0
  3. package/libs/azureiot/built/debug/binary.js +461 -461
  4. package/libs/color/built/debug/binary.js +8 -8
  5. package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/get-tile.md +3 -3
  6. package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/get-tiles-by-type.md +65 -0
  7. package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/on-hit-tile.md +4 -4
  8. package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/place-on-random-tile.md +61 -0
  9. package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/place.md +2 -6
  10. package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap/set-tile-at.md +61 -0
  11. package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/set-tile-map.md +3 -3
  12. package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/set-tile.md +1 -1
  13. package/libs/{game/docs/reference/scene → color-coded-tilemap/docs/reference/color-coded-tilemap}/tile-map.md +2 -2
  14. package/libs/{game/docs/types → color-coded-tilemap/docs/reference/color-coded-tilemap}/tile.md +9 -5
  15. package/libs/color-coded-tilemap/docs/reference/color-coded-tilemap.md +32 -0
  16. package/libs/color-coded-tilemap/tilemap.ts +7 -7
  17. package/libs/color-sensor/built/debug/binary.js +8 -8
  18. package/libs/controller/built/debug/binary.js +7117 -7117
  19. package/libs/controller---none/built/debug/binary.js +7097 -7097
  20. package/libs/datalogger/built/debug/binary.js +63 -63
  21. package/libs/edge-connector/built/debug/binary.js +8 -8
  22. package/libs/edge-connector/docs/reference/edge-connector.md +5 -0
  23. package/libs/esp32/built/debug/binary.js +462 -462
  24. package/libs/feather/docs/reference/feather.md +11 -0
  25. package/libs/game/built/debug/binary.js +7036 -7036
  26. package/libs/lcd/built/debug/binary.js +8 -8
  27. package/libs/light-spectrum-sensor/built/debug/binary.js +8 -8
  28. package/libs/lora/built/debug/binary.js +8 -8
  29. package/libs/matrix-keypad/built/debug/binary.js +8 -8
  30. package/libs/mixer/instrument.ts +28 -9
  31. package/libs/mixer/melody.cpp +43 -0
  32. package/libs/mixer/sequencer.ts +116 -0
  33. package/libs/mixer/sim/music.ts +102 -0
  34. package/libs/mqtt/built/debug/binary.js +176 -176
  35. package/libs/net/built/debug/binary.js +176 -176
  36. package/libs/net-game/built/debug/binary.js +8625 -8625
  37. package/libs/palette/built/debug/binary.js +7035 -7035
  38. package/libs/pixel/built/debug/binary.js +8 -8
  39. package/libs/power/built/debug/binary.js +8 -8
  40. package/libs/proximity/built/debug/binary.js +8 -8
  41. package/libs/radio/built/debug/binary.js +8 -8
  42. package/libs/radio-broadcast/built/debug/binary.js +8 -8
  43. package/libs/rotary-encoder/built/debug/binary.js +8 -8
  44. package/libs/screen/built/debug/binary.js +50 -50
  45. package/libs/servo/built/debug/binary.js +8 -8
  46. package/libs/sprite-scaling/_locales/sprite-scaling-jsdoc-strings.json +18 -1
  47. package/libs/sprite-scaling/_locales/sprite-scaling-strings.json +1 -0
  48. package/libs/sprite-scaling/built/debug/binary.js +7035 -7035
  49. package/libs/sprite-scaling/docs/reference/sprite-scaling.md +23 -0
  50. package/libs/sprite-scaling/docs/reference/sprites/scaling/scale-by-pixels.md +1 -1
  51. package/libs/sprite-scaling/docs/reference/sprites/scaling/scale-to-pixels.md +1 -1
  52. package/libs/sprite-scaling/scaling.ts +24 -0
  53. package/libs/storyboard/built/debug/binary.js +7035 -7035
  54. 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
+ ```
@@ -137,7 +137,7 @@ info.setScore(mySprite.width)
137
137
 
138
138
  ## See also #seealso
139
139
 
140
- [scale by pixels](/reference/sprites/scaling/scale-by-pixels)
140
+ [scale to pixels](/reference/sprites/scaling/scale-to-pixels)
141
141
 
142
142
  ```package
143
143
  sprite-scaling
@@ -133,7 +133,7 @@ info.setScore(mySprite.width)
133
133
 
134
134
  ## See also #seealso
135
135
 
136
- [scale by pixels](/reference/sprites/scaling/scale-to-pixels)
136
+ [scale by pixels](/reference/sprites/scaling/scale-by-pixels)
137
137
 
138
138
  ```package
139
139
  sprite-scaling
@@ -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