1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-12-08 04:58:48 +00:00

Compare commits

...

2 commits

Author SHA1 Message Date
VirtuGuy a17d41d6b7
Merge 450bbe3978 into 758f712eb5 2025-12-07 17:24:07 +00:00
VirtuGuy 450bbe3978 Make rimlight shader better on atlases 2025-12-07 12:23:42 -05:00

View file

@ -192,7 +192,7 @@ class DropShadowShader extends FlxShader
function set_attachedSprite(spr:FlxSprite):FlxSprite
{
attachedSprite = spr;
updateFrameInfo(attachedSprite.frame);
updateFrameInfo(attachedSprite.frameWidth, attachedSprite.frameHeight, attachedSprite.frame.angle);
return spr;
}
@ -217,19 +217,18 @@ class DropShadowShader extends FlxShader
*/
public function onAttachedFrame(name, frameNum, frameIndex)
{
if (attachedSprite != null) updateFrameInfo(attachedSprite.frame);
if (attachedSprite != null) updateFrameInfo(attachedSprite.frameWidth, attachedSprite.frameHeight, attachedSprite.frame.angle);
}
/*
Updates the frame bounds and angle offset of the sprite for the shader.
*/
public function updateFrameInfo(frame:FlxFrame)
public function updateFrameInfo(width:Float, height:Float, angle:Float)
{
// NOTE: uv.right is actually the right pos and uv.bottom is the bottom pos
uFrameBounds.value = [frame.uv.left, frame.uv.top, frame.uv.right, frame.uv.bottom];
uFrameBounds.value = [0, 0, width, height];
// if a frame is rotated the shader will look completely wrong lol
angOffset.value = [frame.angle * FlxAngle.TO_RAD];
angOffset.value = [angle * FlxAngle.TO_RAD];
}
function set_altMaskImage(_bitmapData:BitmapData):BitmapData