@quenty/gamescalingutils 7.7.0 → 7.8.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [7.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gamescalingutils@7.7.0...@quenty/gamescalingutils@7.8.0) (2023-02-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add GameScalingUtils.observeUIScaleForChild(child) ([3c59cb3](https://github.com/Quenty/NevermoreEngine/commit/3c59cb3006191a0eca18b546db1f7f30bc2cc42d))
12
+
13
+
14
+
15
+
16
+
6
17
  # [7.7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/gamescalingutils@7.6.0...@quenty/gamescalingutils@7.7.0) (2023-01-11)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/gamescalingutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/gamescalingutils",
3
- "version": "7.7.0",
3
+ "version": "7.8.0",
4
4
  "description": "Scale ratios for the UI on different devices",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -28,10 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@quenty/blend": "^6.7.0",
32
- "@quenty/instanceutils": "^7.5.0",
33
- "@quenty/loader": "^6.0.1",
34
- "@quenty/rx": "^7.4.0"
31
+ "@quenty/blend": "^6.8.0",
32
+ "@quenty/instanceutils": "^7.6.0",
33
+ "@quenty/loader": "^6.1.0",
34
+ "@quenty/rx": "^7.5.0"
35
35
  },
36
- "gitHead": "db2db00ab4e24a3eab0449b77a00bee6d91f2755"
36
+ "gitHead": "e084b0cc097ddbcb7c782b8ecbd9c2d619c49354"
37
37
  }
@@ -52,6 +52,23 @@ function GameScalingUtils.observeUIScale(screenGui)
52
52
  }), 30)
53
53
  end
54
54
 
55
+ --[=[
56
+ Observes a smoothed out UI scale for a given screenGui
57
+ @param child Instance
58
+ @return Observable<number>
59
+ ]=]
60
+ function GameScalingUtils.observeUIScaleForChild(child)
61
+ return RxInstanceUtils.observeFirstAncestor(child, "ScreenGui"):Pipe({
62
+ Rx.switchMap(function(screenGui)
63
+ if screenGui then
64
+ return GameScalingUtils.observeUIScale(screenGui)
65
+ else
66
+ return Rx.EMPTY
67
+ end
68
+ end)
69
+ })
70
+ end
71
+
55
72
  --[=[
56
73
  Blend equivalent of rendering a UI Scale
57
74