Skip to content

Commit 476336b

Browse files
sector-aHundrec
authored andcommitted
Tweak subtitles position for downscroll
1 parent e0bd5b8 commit 476336b

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

source/funkin/play/PlayState.hx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,11 +1892,11 @@ class PlayState extends MusicBeatSubState
18921892
*/
18931893
function initHealthBar():Void
18941894
{
1895-
var healthBarYPos:Float = Preferences.downscroll ? FlxG.height * 0.1 : FlxG.height * 0.9;
1896-
#if mobile
1897-
if (Preferences.controlsScheme == FunkinHitboxControlSchemes.Arrows
1898-
&& !ControlsHandler.usingExternalInputDevice) healthBarYPos = FlxG.height * 0.1;
1899-
#end
1895+
final isDownscroll:Bool = #if mobile (Preferences.controlsScheme == FunkinHitboxControlSchemes.Arrows
1896+
&& !ControlsHandler.usingExternalInputDevice)
1897+
|| #end Preferences.downscroll;
1898+
1899+
var healthBarYPos:Float = isDownscroll ? FlxG.height * 0.1 : FlxG.height * 0.9;
19001900

19011901
healthBarBG.y = healthBarYPos;
19021902
healthBarBG.screenCenter(X);
@@ -1929,7 +1929,12 @@ class PlayState extends MusicBeatSubState
19291929
// Create subtitles if they are enabled.
19301930
if (Preferences.subtitles)
19311931
{
1932-
subtitles = new Subtitles(healthBarBG.y * 0.85);
1932+
final isDownscroll:Bool = #if mobile (Preferences.controlsScheme == FunkinHitboxControlSchemes.Arrows
1933+
&& !ControlsHandler.usingExternalInputDevice)
1934+
|| #end Preferences.downscroll;
1935+
1936+
var subtitlesYPos:Float = isDownscroll ? healthBarBG.y * 1.85 : healthBarBG.y * 0.85;
1937+
subtitles = new Subtitles(subtitlesYPos);
19331938
subtitles.zIndex = 10000;
19341939
add(subtitles);
19351940

source/funkin/play/components/Subtitles.hx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import funkin.util.SRTUtil.SRTParser;
1313
*/
1414
class Subtitles extends FlxSpriteGroup
1515
{
16-
var yOrigin:Float;
17-
1816
var subtitleText:SubtitlesText;
1917
var background:FlxSprite;
2018

@@ -25,8 +23,6 @@ class Subtitles extends FlxSpriteGroup
2523
{
2624
super(0, y);
2725

28-
yOrigin = y;
29-
3026
background = new FlxSprite(0, 0);
3127
background.alpha = 0.5;
3228
add(background);
@@ -101,10 +97,6 @@ class Subtitles extends FlxSpriteGroup
10197

10298
background.makeGraphic(Math.ceil(subtitleText.width), Math.ceil(subtitleText.height), FlxColor.BLACK, true);
10399

104-
final yOffset:Float = yOrigin - (subtitleText.height / lines.length) * (lines.length - 1);
105-
subtitleText.y = yOffset;
106-
background.y = yOffset;
107-
108100
screenCenter(X);
109101
}
110102
}

0 commit comments

Comments
 (0)