Skip to content

Commit

Permalink
give selected icon a yellow tint
Browse files Browse the repository at this point in the history
  • Loading branch information
lemz1 committed Nov 10, 2024
1 parent 837eaba commit b894ddc
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class CharSelectIndexSubPage extends FlxSpriteGroup
var grpIcons:FlxSpriteGroup;
final grpXSpread:Float = 107;
final grpYSpread:Float = 127;
var iconTint:PixelatedIcon;

function initLocks():Void
{
Expand Down Expand Up @@ -205,6 +206,18 @@ class CharSelectIndexSubPage extends FlxSpriteGroup
}

updateIconPositions();

var selectedIcon = grpIcons.members[parentPage.selectedIndexData];

iconTint = new PixelatedIcon(selectedIcon.x, selectedIcon.y);
iconTint.setCharacter("bf");
iconTint.setGraphicSize(128, 128);
iconTint.updateHitbox();
var yellowShader = new funkin.graphics.shaders.PureColor(0xFFFFFF00);
yellowShader.colorSet = true;
iconTint.shader = yellowShader;
iconTint.blend = BlendMode.MULTIPLY;
add(iconTint);
}

function updateIconPositions():Void
Expand Down Expand Up @@ -280,6 +293,9 @@ class CharSelectIndexSubPage extends FlxSpriteGroup
return;
}

iconTint.x = selectedIcon.x;
iconTint.y = selectedIcon.y;

parentPage.selectedIndexData = cursorIndex;
FlxG.sound.play(Paths.sound('CS_confirm'));

Expand Down

0 comments on commit b894ddc

Please sign in to comment.