diff --git a/source/ColorpickSubstate.hx b/source/ColorpickSubstate.hx index 6123acc9b..b988acce4 100644 --- a/source/ColorpickSubstate.hx +++ b/source/ColorpickSubstate.hx @@ -1,7 +1,10 @@ package; import flixel.FlxG; +import flixel.addons.effects.chainable.FlxEffectSprite; +import flixel.addons.effects.chainable.FlxOutlineEffect; import flixel.group.FlxGroup.FlxTypedGroup; +import flixel.util.FlxColor; import shaderslmfao.ColorSwap; class ColorpickSubstate extends MusicBeatSubstate @@ -24,6 +27,14 @@ class ColorpickSubstate extends MusicBeatSubstate note.x = (100 * i) + i; note.screenCenter(Y); + var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]); + add(_effectSpr); + _effectSpr.y = 0; + _effectSpr.x = i * 80; + _effectSpr.antialiasing = true; + _effectSpr.setGraphicSize(Std.int(_effectSpr.width * 0.7)); + _effectSpr.updateHitbox(); + grpNotes.add(note); } } diff --git a/source/shaderslmfao/ColorSwap.hx b/source/shaderslmfao/ColorSwap.hx index 1f57dc7a0..33272e476 100644 --- a/source/shaderslmfao/ColorSwap.hx +++ b/source/shaderslmfao/ColorSwap.hx @@ -53,6 +53,9 @@ class ColorSwapShader extends FlxShader uniform float uTime; uniform float money; + const float offset = 1.0 / 128.0; + + vec3 normalizeColor(vec3 color) { return vec3( @@ -93,8 +96,22 @@ class ColorSwapShader extends FlxShader // money += swagColor[0]; color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]); - - gl_FragColor = color; +/* + if (color.a > 0.5) + gl_FragColor = color; + else + { + float a = flixel_texture2D(bitmap, vec2(openfl_TextureCoordv + offset, openfl_TextureCoordv.y)).a + + flixel_texture2D(bitmap, vec2(openfl_TextureCoordv, openfl_TextureCoordv.y - offset)).a + + flixel_texture2D(bitmap, vec2(openfl_TextureCoordv - offset, openfl_TextureCoordv.y)).a + + flixel_texture2D(bitmap, vec2(openfl_TextureCoordv, openfl_TextureCoordv.y + offset)).a; + if (color.a < 1.0 && a > 0.0) + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.8); + else + gl_FragColor = color; + } + */ + } ')