Skip to main content

RainShader

Kindclass
Packageshaders
Full nameshaders.RainShader
Sourcesource/shaders/RainShader.hx
ExtendsFlxFixedShader

Public fields​

NameTypeStaticDefaultNotes
lightsArray<no——
timeFloatno1property (default, set)
scaleFloatno1property (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.
intensityFloatno0.5property (default, set) · The intensity of the rain. Zero means no rain and one means the maximum amount of rain.
puddleYFloatno0property (default, set) · the y coord of the puddle, used to mirror things
puddleScaleYFloatno0property (default, set) · the y scale of the puddle, the less this value the more the puddle effects squished
blurredScreenBitmapDatano—property (default, set)
maskBitmapDatano—property (default, set)
lightMapBitmapDatano—property (default, set)
numLightsSwagIntno0property (default, set)

Public methods​

new (constructor)​

function new()

View source

update​

function update(elapsed:Float):Void
ParameterTypeDefault
elapsedFloat—

View source

updateViewInfo​

function updateViewInfo(screenWidth:Float, screenHeight:Float, camera:FlxCamera):Void
ParameterTypeDefault
screenWidthFloat—
screenHeightFloat—
cameraFlxCamera—

View source

Internals​

Private / internal members
FieldTypeStatic
MAX_LIGHTSIntyes
_sizeArray<Float>no
_viewArray<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>