mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-18 18:47:48 +00:00
make main menu bg not go offscreen when selecting options, add offsets for menu items
This commit is contained in:
parent
9885b03b7d
commit
367cb8b1cc
|
@ -45,7 +45,7 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
|
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
|
||||||
bg.scrollFactor.x = 0;
|
bg.scrollFactor.x = 0;
|
||||||
bg.scrollFactor.y = 0.18;
|
bg.scrollFactor.y = 0.17;
|
||||||
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
||||||
bg.updateHitbox();
|
bg.updateHitbox();
|
||||||
bg.screenCenter();
|
bg.screenCenter();
|
||||||
|
@ -57,7 +57,7 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
|
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
|
||||||
magenta.scrollFactor.x = 0;
|
magenta.scrollFactor.x = 0;
|
||||||
magenta.scrollFactor.y = 0.18;
|
magenta.scrollFactor.y = 0.17;
|
||||||
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
|
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
|
||||||
magenta.updateHitbox();
|
magenta.updateHitbox();
|
||||||
magenta.screenCenter();
|
magenta.screenCenter();
|
||||||
|
@ -208,11 +208,25 @@ class MainMenuState extends MusicBeatState
|
||||||
|
|
||||||
if (spr.ID == curSelected)
|
if (spr.ID == curSelected)
|
||||||
{
|
{
|
||||||
spr.animation.play('selected');
|
|
||||||
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
|
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
|
||||||
|
spr.animation.play('selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
spr.updateHitbox();
|
spr.updateHitbox();
|
||||||
|
if(spr.animation.curAnim.name == 'selected')
|
||||||
|
{
|
||||||
|
switch(optionShit[curSelected])
|
||||||
|
{
|
||||||
|
case 'story mode':
|
||||||
|
spr.offset.y += 26;
|
||||||
|
case 'freeplay':
|
||||||
|
spr.offset.y += 28;
|
||||||
|
case 'donate':
|
||||||
|
spr.offset.y += 21;
|
||||||
|
case 'options':
|
||||||
|
spr.offset.y += 26;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue