@quenty/timedtween 2.3.0 → 2.3.1-canary.436.cb76259.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
+ ## [2.3.1-canary.436.cb76259.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timedtween@2.3.0...@quenty/timedtween@2.3.1-canary.436.cb76259.0) (2024-01-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add TimedTween:GetTransitionTime() and TimedTween:ObserveTransitionTime() ([22f95a4](https://github.com/Quenty/NevermoreEngine/commit/22f95a4d76063dec5e14d0848fa27ee24ead2bb1))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timedtween@2.2.0...@quenty/timedtween@2.3.0) (2023-12-28)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/timedtween
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/timedtween",
3
- "version": "2.3.0",
3
+ "version": "2.3.1-canary.436.cb76259.0",
4
4
  "description": "Linear timed tweening model",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,19 +25,19 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/basicpane": "^8.3.0",
29
- "@quenty/blend": "^7.3.0",
30
- "@quenty/loader": "^7.1.0",
31
- "@quenty/maid": "^2.6.0",
32
- "@quenty/math": "^2.5.0",
33
- "@quenty/promise": "^7.1.0",
34
- "@quenty/promisemaid": "^2.1.0",
35
- "@quenty/rx": "^8.3.0",
36
- "@quenty/steputils": "^3.3.0",
37
- "@quenty/valueobject": "^8.3.0"
28
+ "@quenty/basicpane": "8.3.1-canary.436.cb76259.0",
29
+ "@quenty/blend": "7.3.1-canary.436.cb76259.0",
30
+ "@quenty/loader": "7.1.1-canary.436.cb76259.0",
31
+ "@quenty/maid": "2.6.0",
32
+ "@quenty/math": "2.5.0",
33
+ "@quenty/promise": "7.1.1-canary.436.cb76259.0",
34
+ "@quenty/promisemaid": "2.1.1-canary.436.cb76259.0",
35
+ "@quenty/rx": "8.3.1-canary.436.cb76259.0",
36
+ "@quenty/steputils": "3.3.0",
37
+ "@quenty/valueobject": "8.3.1-canary.436.cb76259.0"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "7440d02391695fa3e9c22f8c8285451ccfa32ad5"
42
+ "gitHead": "cb7625914c075100546dbd26c7d04eda3c9bd3e4"
43
43
  }
@@ -1,4 +1,6 @@
1
1
  --[=[
2
+ Tween that is a specific time, useful for countdowns and other things
3
+
2
4
  @class TimedTween
3
5
  ]=]
4
6
 
@@ -18,6 +20,12 @@ local TimedTween = setmetatable({}, BasicPane)
18
20
  TimedTween.ClassName = "TimedTween"
19
21
  TimedTween.__index = TimedTween
20
22
 
23
+ --[=[
24
+ Timed transition module
25
+
26
+ @param transitionTime number? -- Optional
27
+ @return TimedTween
28
+ ]=]
21
29
  function TimedTween.new(transitionTime)
22
30
  local self = setmetatable(BasicPane.new(), TimedTween)
23
31
 
@@ -45,14 +53,49 @@ function TimedTween.new(transitionTime)
45
53
  return self
46
54
  end
47
55
 
56
+ --[=[
57
+ Sets the transition time
58
+
59
+ @param transitionTime number | Observable<number>
60
+ @return MaidTask
61
+ ]=]
48
62
  function TimedTween:SetTransitionTime(transitionTime)
49
63
  return self._transitionTime:Mount(transitionTime)
50
64
  end
51
65
 
66
+ --[=[
67
+ Gets the transition time
68
+
69
+ @return number
70
+ ]=]
71
+ function TimedTween:GetTransitionTime()
72
+ return self._transitionTime.Value
73
+ end
74
+
75
+ --[=[
76
+ Observes the transition time
77
+
78
+ @return Observable<number>
79
+ ]=]
80
+ function TimedTween:ObserveTransitionTime()
81
+ return self._transitionTime:Observe()
82
+ end
83
+
84
+ --[=[
85
+ Observes how far into the transition we are, from 0 to 1
86
+
87
+ @return Observable<number>
88
+ ]=]
52
89
  function TimedTween:ObserveRenderStepped()
53
90
  return self:ObserveOnSignal(RunService.RenderStepped)
54
91
  end
55
92
 
93
+ --[=[
94
+ Observes the transition on a specific signal
95
+
96
+ @param signal Signal
97
+ @return Observable<number>
98
+ ]=]
56
99
  function TimedTween:ObserveOnSignal(signal)
57
100
  return Observable.new(function(sub)
58
101
  local maid = Maid.new()
@@ -71,10 +114,20 @@ function TimedTween:ObserveOnSignal(signal)
71
114
  end)
72
115
  end
73
116
 
117
+ --[=[
118
+ Observes the transition
119
+
120
+ @return Observable<number>
121
+ ]=]
74
122
  function TimedTween:Observe()
75
123
  return self:ObserveOnSignal(RunService.RenderStepped)
76
124
  end
77
125
 
126
+ --[=[
127
+ Promises when the tween is finished
128
+
129
+ @return Promise
130
+ ]=]
78
131
  function TimedTween:PromiseFinished()
79
132
  local initState = self:_computeState(os.clock())
80
133
  if initState.rtime <= 0 then