圆形遮罩,正中间的圆形渲染

Constructor

@:value({ circleScale : 1 })@:glFragmentSource("#pragma header\nuniform float u_scale;\nvoid main(void){\n\t#pragma body\n\tfloat len = (openfl_TextureSize.x < openfl_TextureSize.y) ? openfl_TextureSize.x : openfl_TextureSize.y;\n\tif(distance(vec2(0.5) * openfl_TextureSize, openfl_TextureCoordv.xy * openfl_TextureSize) < len * 0.5){\n\t\tgl_FragColor = texture2D(openfl_Texture, openfl_TextureCoordv);\n\t}else{\n\t\tgl_FragColor = vec4(0.);\n\t}\n}")new (circleScale:Float = 1)

圆形遮罩,设置比例来覆盖圆形的范围。

Parameters:

null

circleScale

Variables

@:uniformscale:Float

@:keepu_scale:ShaderParameter<Float>

Methods