RainShader
| Kind | class |
| Package | shaders |
| Full name | shaders.RainShader |
| Source | source/shaders/RainShader.hx |
| Extends | FlxFixedShader |
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
lights | Array< | no | — | — |
time | Float | no | 1 | property (default, set) |
scale | Float | no | 1 | property (default, set) · The scale of the rain depends on the world coordinate system, so higher resolution makes the raindrops smaller. This parameter can be used to adjust the total scale of the scene. The size of the raindrops is proportional to the value of this parameter. |
intensity | Float | no | 0.5 | property (default, set) · The intensity of the rain. Zero means no rain and one means the maximum amount of rain. |
puddleY | Float | no | 0 | property (default, set) · the y coord of the puddle, used to mirror things |
puddleScaleY | Float | no | 0 | property (default, set) · the y scale of the puddle, the less this value the more the puddle effects squished |
blurredScreen | BitmapData | no | — | property (default, set) |
mask | BitmapData | no | — | property (default, set) |
lightMap | BitmapData | no | — | property (default, set) |
numLightsSwag | Int | no | 0 | property (default, set) |
Public methods
new (constructor)
function new()
update
function update(elapsed:Float):Void
| Parameter | Type | Default |
|---|---|---|
elapsed | Float | — |
updateViewInfo
function updateViewInfo(screenWidth:Float, screenHeight:Float, camera:FlxCamera):Void
| Parameter | Type | Default |
|---|---|---|
screenWidth | Float | — |
screenHeight | Float | — |
camera | FlxCamera | — |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
MAX_LIGHTS | Int | yes |
_size | Array<Float> | no |
_view | Array<Float> | no |
| Method |
|---|
function set_time(value:Float):Float |
function set_scale(value:Float):Float |
function set_intensity(value:Float):Float |
function set_puddleY(value:Float):Float |
function set_puddleScaleY(value:Float):Float |
function set_blurredScreen(value:BitmapData):BitmapData |
function set_mask(value:BitmapData):BitmapData |
function set_lightMap(value:BitmapData):BitmapData |
function set_numLightsSwag(value:Int):Int |
function addFloatUniform(name:String, length:Int):ShaderParameter<Float> |