mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-27 10:05:41 -05:00
checkbox thingie hehe
This commit is contained in:
parent
17545fbc86
commit
00bfd26703
1 changed files with 20 additions and 4 deletions
|
@ -107,27 +107,43 @@ class PreferencesMenu extends ui.OptionsState.Page
|
|||
|
||||
class CheckboxThingie extends FlxSprite
|
||||
{
|
||||
public var daValue(default, set):Bool = false;
|
||||
public var daValue(default, set):Bool;
|
||||
|
||||
public function new(x:Float, y:Float, daValue:Bool = false)
|
||||
{
|
||||
super(x, y);
|
||||
|
||||
frames = Paths.getSparrowAtlas('checkboxThingie');
|
||||
animation.addByPrefix('static', 'Check Box unselected', 24, false);
|
||||
animation.addByPrefix('checked', 'Check Box selecting animation', 24, false);
|
||||
|
||||
antialiasing = true;
|
||||
|
||||
setGraphicSize(Std.int(width * 0.7));
|
||||
updateHitbox();
|
||||
|
||||
this.daValue = daValue;
|
||||
makeGraphic(50, 50, FlxColor.WHITE);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
switch (animation.curAnim.name)
|
||||
{
|
||||
case 'static':
|
||||
offset.set();
|
||||
case 'checked':
|
||||
offset.set(17, 70);
|
||||
}
|
||||
}
|
||||
|
||||
function set_daValue(value:Bool):Bool
|
||||
{
|
||||
if (value)
|
||||
color = FlxColor.GREEN;
|
||||
animation.play('checked', true);
|
||||
else
|
||||
color = FlxColor.RED;
|
||||
animation.play('static');
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue