Skip to content

Commit 032248c

Browse files
committed
Snap charSelect cursor's positions on create and move them in an in/out motion sequence
1 parent 8952aca commit 032248c

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

source/funkin/ui/charSelect/CharSelectSubState.hx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,49 @@ class CharSelectSubState extends MusicBeatSubState
357357
FlxTween.tween(member, {y: member.y - 300}, 1, {ease: FlxEase.expoOut});
358358
}
359359

360+
/*
361+
cursor.scrollFactor.set();
362+
cursorBlue.scrollFactor.set();
363+
cursorDarkBlue.scrollFactor.set();
364+
365+
FlxTween.color(cursor, 0.2, 0xFFFFFF00, 0xFFFFCC00, {type: PINGPONG});
366+
367+
cursorLocIntended.x = (cursorFactor * cursorX) + (FlxG.width / 2) - cursor.width / 2;
368+
cursorLocIntended.y = (cursorFactor * cursorY) + (FlxG.height / 2) - cursor.height / 2;
369+
370+
cursorLocIntended.x += cursorOffsetX;
371+
cursorLocIntended.y += cursorOffsetY;
372+
373+
cursor.x = cursorLocIntended.x;
374+
cursor.y = cursorLocIntended.y;
375+
376+
cursorBlue.x = cursor.x;
377+
cursorBlue.y = cursor.y;
378+
379+
cursorDarkBlue.x = cursorLocIntended.x;
380+
cursorDarkBlue.y = cursorLocIntended.y;
381+
382+
cursorConfirmed.x = cursor.x - 2;
383+
cursorConfirmed.y = cursor.y - 4;
384+
385+
cursorDenied.x = cursor.x - 2;
386+
cursorDenied.y = cursor.y - 4;
387+
388+
var cursorsIntroOffset:Float = 240;
389+
390+
// start invisible and slightly offset (slide up into place)
391+
cursor.alpha = 0;
392+
cursorBlue.alpha = 0;
393+
cursorDarkBlue.alpha = 0;
394+
395+
cursor.y += cursorsIntroOffset;
396+
cursorBlue.y += cursorsIntroOffset;
397+
cursorDarkBlue.y += cursorsIntroOffset;
398+
399+
FlxTween.tween(cursor, {alpha: 1, y: cursor.y - cursorsIntroOffset}, 0.9, {ease: FlxEase.expoOut});
400+
FlxTween.tween(cursorBlue, {alpha: 1, y: cursorBlue.y - cursorsIntroOffset}, 0.95, {ease: FlxEase.expoOut});
401+
FlxTween.tween(cursorDarkBlue, {alpha: 1, y: cursorDarkBlue.y - cursorsIntroOffset}, 1.0, {ease: FlxEase.expoOut}); */
402+
360403
FlxG.debugger.addTrackerProfile(new TrackerProfile(CharSelectSubState, ["curChar", "grpXSpread", "grpYSpread"]));
361404
FlxG.debugger.track(this);
362405

@@ -685,6 +728,12 @@ class CharSelectSubState extends MusicBeatSubState
685728

686729
FlxTween.tween(cursors, {alpha: 0}, 0.8, {ease: FlxEase.expoOut});
687730

731+
/*var cursorsOutroOffset:Float = 240;
732+
FlxTween.tween(cursor, {alpha: 0, y: cursor.y + cursorsOutroOffset}, 0.8, {ease: FlxEase.backIn});
733+
FlxTween.tween(cursorBlue, {alpha: 0, y: cursorBlue.y + cursorsOutroOffset}, 0.82, {ease: FlxEase.backIn});
734+
FlxTween.tween(cursorDarkBlue, {alpha: 0, y: cursorDarkBlue.y + cursorsOutroOffset}, 0.84, {ease: FlxEase.backIn});
735+
FlxTween.tween(cursorConfirmed, {alpha: 0}, 0.8, {ease: FlxEase.expoOut}); */
736+
688737
FlxTween.tween(barthing, {y: barthing.y + 80}, 0.8, {ease: FlxEase.backIn});
689738
FlxTween.tween(nametag, {y: nametag.y + 80}, 0.8, {ease: FlxEase.backIn});
690739
FlxTween.tween(dipshitBacking, {y: dipshitBacking.y + 210}, 0.8, {ease: FlxEase.backIn});

0 commit comments

Comments
 (0)