Files
netease-modsdk-wiki/docs/mcdocs/1-ModAPI/接口/后处理/渐晕.md
2025-03-17 13:24:39 +08:00

200 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebarDepth: 1
---
# 渐晕
## CheckVignetteEnabled
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.postProcessControlComp.PostProcessComponent
- 描述
检测是否开启了屏幕渐晕Vignette效果。
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | True为已开启False为已关闭。 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePostProcess(levelId)
comp.CheckVignetteEnabled()
```
## SetEnableVignette
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.postProcessControlComp.PostProcessComponent
- 描述
设置是否开启屏幕渐晕Vignette效果开启后玩家屏幕周围将出现渐晕可通过Vignette其他接口设置效果参数。
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| enable | bool | 是否开启Vignette效果True为开启False为关闭。 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 设置是否成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePostProcess(levelId)
comp.SetEnableVignette(True)
```
## SetVignetteCenter
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.postProcessControlComp.PostProcessComponent
- 描述
设置渐晕Vignette的渐晕中心位置可改变屏幕渐晕的位置。
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| center | tuple(float,float) | 按顺序分别为屏幕位置的x及y值。 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 设置是否成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePostProcess(levelId)
# 调整渐晕中心位置为屏幕中心
comp.SetVignetteCenter((0.5,0.5))
```
## SetVignetteRGB
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.postProcessControlComp.PostProcessComponent
- 描述
设置渐晕Vignette的渐晕颜色可改变屏幕渐晕的颜色。
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| color | tuple(float,float,float) | 按顺序分别为颜色的RGB值值的范围为[0,255]小于或大于这个范围的值将被截取为边界值0或255 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 设置是否成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePostProcess(levelId)
# 设置颜色的值为红色。
comp.SetVignetteRGB((255,0,0))
```
## SetVignetteRadius
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.postProcessControlComp.PostProcessComponent
- 描述
设置渐晕Vignette的渐晕半径半径越大渐晕越小玩家的视野范围越大。
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| radius | float | 渐晕半径大小,值的范围为[0,1]小于或大于这个范围的值将被截取为边界值0或1 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 设置是否成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePostProcess(levelId)
# 调整渐晕半径为0.5
comp.SetVignetteRadius(0.5)
```
## SetVignetteSmoothness
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.postProcessControlComp.PostProcessComponent
- 描述
设置渐晕Vignette的渐晕模糊系数模糊系数越大则渐晕边缘越模糊模糊的范围也越大
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| radius | float | 渐晕模糊系数,值的范围为[0,1]小于或大于这个范围的值将被截取为边界值0或1 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 设置是否成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePostProcess(levelId)
# 调整渐晕模糊系数为0.5
comp.SetVignetteSmoothness(0.5)
```