1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-29 18:24:23 +00:00
Funkin/source/funkin/shaderslmfao/BlendModeEffect.hx

35 lines
757 B
Haxe
Raw Normal View History

package funkin.shaderslmfao;
2020-12-27 02:46:22 +00:00
import flixel.util.FlxColor;
import openfl.display.ShaderParameter;
typedef BlendModeShader =
{
var uBlendColor:ShaderParameter<Float>;
2020-12-27 02:46:22 +00:00
}
class BlendModeEffect
{
public var shader(default, null):BlendModeShader;
2020-12-27 02:46:22 +00:00
@:isVar
public var color(default, set):FlxColor;
2020-12-27 02:46:22 +00:00
public function new(shader:BlendModeShader, color:FlxColor):Void
{
shader.uBlendColor.value = [];
this.shader = shader;
this.color = color;
}
2020-12-27 02:46:22 +00:00
function set_color(color:FlxColor):FlxColor
{
shader.uBlendColor.value[0] = color.redFloat;
shader.uBlendColor.value[1] = color.greenFloat;
shader.uBlendColor.value[2] = color.blueFloat;
shader.uBlendColor.value[3] = color.alphaFloat;
2020-12-27 02:46:22 +00:00
return this.color = color;
}
2020-12-27 02:46:22 +00:00
}