Funkin/source/funkin/ui/ColorsMenu.hx

68 lines
1.7 KiB
Haxe
Raw Normal View History

package funkin.ui;
2021-03-24 16:44:58 -04:00
import flixel.addons.effects.chainable.FlxEffectSprite;
import flixel.addons.effects.chainable.FlxOutlineEffect;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.util.FlxColor;
import funkin.ui.OptionsState.Page;
2023-06-22 01:41:01 -04:00
import funkin.play.notes.NoteSprite;
2021-03-24 16:44:58 -04:00
class ColorsMenu extends Page
2021-03-24 16:44:58 -04:00
{
var curSelected:Int = 0;
2021-03-24 16:44:58 -04:00
2023-06-22 01:41:01 -04:00
var grpNotes:FlxTypedGroup<NoteSprite>;
2021-03-24 16:44:58 -04:00
public function new()
{
super();
2021-03-24 16:44:58 -04:00
2023-06-22 01:41:01 -04:00
grpNotes = new FlxTypedGroup<NoteSprite>();
add(grpNotes);
2021-03-24 16:44:58 -04:00
for (i in 0...4)
{
2023-06-22 01:41:01 -04:00
var note:NoteSprite = new NoteSprite(0, i);
2021-03-24 16:44:58 -04:00
note.x = (100 * i) + i;
note.screenCenter(Y);
2021-03-24 16:44:58 -04:00
var _effectSpr:FlxEffectSprite = new FlxEffectSprite(note, [new FlxOutlineEffect(FlxOutlineMode.FAST, FlxColor.WHITE, 4, 1)]);
add(_effectSpr);
_effectSpr.y = 0;
_effectSpr.x = i * 130;
_effectSpr.scale.x = _effectSpr.scale.y = 0.7;
// _effectSpr.setGraphicSize();
_effectSpr.height = note.height;
_effectSpr.width = note.width;
2021-03-24 18:41:54 -04:00
// _effectSpr.updateHitbox();
2021-03-24 16:44:58 -04:00
grpNotes.add(note);
}
}
2021-03-24 16:44:58 -04:00
override function update(elapsed:Float)
{
if (controls.UI_RIGHT_P) curSelected += 1;
if (controls.UI_LEFT_P) curSelected -= 1;
2021-03-24 16:44:58 -04:00
if (curSelected < 0) curSelected = grpNotes.members.length - 1;
if (curSelected >= grpNotes.members.length) curSelected = 0;
2021-03-24 16:44:58 -04:00
if (controls.UI_UP)
{
2023-06-22 01:41:01 -04:00
// grpNotes.members[curSelected].colorSwap.update(elapsed * 0.3);
// Note.arrowColors[curSelected] += elapsed * 0.3;
}
2021-03-24 16:44:58 -04:00
if (controls.UI_DOWN)
{
2023-06-22 01:41:01 -04:00
// grpNotes.members[curSelected].colorSwap.update(-elapsed * 0.3);
// Note.arrowColors[curSelected] += -elapsed * 0.3;
}
2021-03-24 16:44:58 -04:00
super.update(elapsed);
}
2021-03-24 16:44:58 -04:00
}