@quenty/modeltransparencyeffect 3.1.3-canary.c50dead.0 → 3.2.1
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 +10 -2
- package/LICENSE.md +1 -1
- package/README.md +6 -18
- package/package.json +7 -7
- package/src/Client/ModelTransparencyEffect.lua +36 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,20 @@
|
|
|
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
|
-
## [3.1
|
|
6
|
+
## [3.2.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@3.2.0...@quenty/modeltransparencyeffect@3.2.1) (2021-12-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/modeltransparencyeffect
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@3.1.2...@quenty/modeltransparencyeffect@3.2.0) (2021-11-20)
|
|
7
15
|
|
|
8
16
|
|
|
9
17
|
### Bug Fixes
|
|
10
18
|
|
|
11
|
-
* Support MacOS syncing ([
|
|
19
|
+
* Support MacOS syncing ([#225](https://github.com/Quenty/NevermoreEngine/issues/225)) ([03f9183](https://github.com/Quenty/NevermoreEngine/commit/03f918392c6a5bdd33f8a17c38de371d1e06c67a))
|
|
12
20
|
|
|
13
21
|
|
|
14
22
|
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## ModelTransparencyEffect
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="http://quenty.github.io/
|
|
4
|
-
<img src="https://
|
|
3
|
+
<a href="http://quenty.github.io/NevermoreEngine/">
|
|
4
|
+
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://discord.gg/mhtGUS8">
|
|
7
|
-
<img src="https://img.shields.io/
|
|
7
|
+
<img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://github.com/Quenty/NevermoreEngine/actions">
|
|
10
10
|
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
|
|
@@ -13,21 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
Allows a model to have transparent set locally on the client
|
|
15
15
|
|
|
16
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/ModelTransparencyEffect">View docs →</a></div>
|
|
17
|
+
|
|
16
18
|
## Installation
|
|
17
19
|
```
|
|
18
20
|
npm install @quenty/modeltransparencyeffect --save
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
Usage is designed to be simple.
|
|
23
|
-
|
|
24
|
-
### `ModelTransparencyEffect.new(adornee, transparencyServiceMethodName)`
|
|
25
|
-
|
|
26
|
-
### `ModelTransparencyEffect:SetAcceleration(acceleration)`
|
|
27
|
-
|
|
28
|
-
### `ModelTransparencyEffect:SetTransparency(transparency, doNotAnimate)`
|
|
29
|
-
|
|
30
|
-
### `ModelTransparencyEffect:IsDoneAnimating()`
|
|
31
|
-
|
|
32
|
-
### `ModelTransparencyEffect:FinishTransparencyAnimation(callback)`
|
|
33
|
-
|
|
21
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/modeltransparencyeffect",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Allows a model to have transparent set locally on the client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/acceltween": "2.0.
|
|
29
|
-
"@quenty/baseobject": "3.1
|
|
30
|
-
"@quenty/loader": "3.1.
|
|
31
|
-
"@quenty/steputils": "3.0.
|
|
32
|
-
"@quenty/transparencyservice": "3.
|
|
28
|
+
"@quenty/acceltween": "^2.0.1",
|
|
29
|
+
"@quenty/baseobject": "^3.2.1",
|
|
30
|
+
"@quenty/loader": "^3.1.2",
|
|
31
|
+
"@quenty/steputils": "^3.0.1",
|
|
32
|
+
"@quenty/transparencyservice": "^3.2.1"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "d146c77d0a8e452824de0ab0b4b03ba0370bcc1b"
|
|
38
38
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Allows a model to have transparent set locally on the client
|
|
3
|
+
|
|
4
|
+
@client
|
|
5
|
+
@class ModelTransparencyEffect
|
|
6
|
+
]=]
|
|
4
7
|
|
|
5
8
|
local require = require(script.Parent.loader).load(script)
|
|
6
9
|
|
|
@@ -13,6 +16,12 @@ local ModelTransparencyEffect = setmetatable({}, BaseObject)
|
|
|
13
16
|
ModelTransparencyEffect.ClassName = "ModelTransparencyEffect"
|
|
14
17
|
ModelTransparencyEffect.__index = ModelTransparencyEffect
|
|
15
18
|
|
|
19
|
+
--[=[
|
|
20
|
+
@param serviceBag ServiceBag
|
|
21
|
+
@param adornee Instance
|
|
22
|
+
@param transparencyServiceMethodName "SetTransparency" | "SetLocalTransparencyModifier" | nil
|
|
23
|
+
@return ModelTransparencyEffect
|
|
24
|
+
]=]
|
|
16
25
|
function ModelTransparencyEffect.new(serviceBag, adornee, transparencyServiceMethodName)
|
|
17
26
|
local self = setmetatable(BaseObject.new(adornee), ModelTransparencyEffect)
|
|
18
27
|
|
|
@@ -31,10 +40,19 @@ function ModelTransparencyEffect.new(serviceBag, adornee, transparencyServiceMet
|
|
|
31
40
|
return self
|
|
32
41
|
end
|
|
33
42
|
|
|
43
|
+
--[=[
|
|
44
|
+
Sets the acceleration
|
|
45
|
+
@param acceleration number
|
|
46
|
+
]=]
|
|
34
47
|
function ModelTransparencyEffect:SetAcceleration(acceleration)
|
|
35
48
|
self._transparency.a = acceleration
|
|
36
49
|
end
|
|
37
50
|
|
|
51
|
+
--[=[
|
|
52
|
+
Sets the transparency
|
|
53
|
+
@param transparency number
|
|
54
|
+
@param doNotAnimate boolean
|
|
55
|
+
]=]
|
|
38
56
|
function ModelTransparencyEffect:SetTransparency(transparency, doNotAnimate)
|
|
39
57
|
if self._transparency.t == transparency then
|
|
40
58
|
return
|
|
@@ -48,16 +66,29 @@ function ModelTransparencyEffect:SetTransparency(transparency, doNotAnimate)
|
|
|
48
66
|
self:_startAnimation()
|
|
49
67
|
end
|
|
50
68
|
|
|
69
|
+
--[=[
|
|
70
|
+
Returns true if animation is done
|
|
71
|
+
@return boolean
|
|
72
|
+
]=]
|
|
51
73
|
function ModelTransparencyEffect:IsDoneAnimating()
|
|
52
74
|
return self._transparency.rtime == 0
|
|
53
75
|
end
|
|
54
76
|
|
|
77
|
+
--[=[
|
|
78
|
+
Finishes the transparency animation, and then calls the callback to
|
|
79
|
+
finish the animation.
|
|
80
|
+
@param callback function
|
|
81
|
+
]=]
|
|
55
82
|
function ModelTransparencyEffect:FinishTransparencyAnimation(callback)
|
|
56
83
|
self:SetTransparency(0)
|
|
57
84
|
|
|
58
|
-
|
|
85
|
+
if self._transparency.rtime == 0 then
|
|
59
86
|
callback()
|
|
60
|
-
|
|
87
|
+
else
|
|
88
|
+
task.delay(self._transparency.rtime, function()
|
|
89
|
+
callback()
|
|
90
|
+
end)
|
|
91
|
+
end
|
|
61
92
|
end
|
|
62
93
|
|
|
63
94
|
|