From 3360493444129a4a44b98486a915180bf7457e9b Mon Sep 17 00:00:00 2001 From: fabs Date: Mon, 9 Jun 2025 03:14:57 +0100 Subject: [PATCH 01/12] implement extended assets --- source/funkin/ui/charSelect/CharSelectSubState.hx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index a2e206beb..dc1e835d6 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -126,6 +126,8 @@ class CharSelectSubState extends MusicBeatSubState var fadeShader:BlueFade = new BlueFade(); + var speakers2:FlxAtlasSprite; + override public function create():Void { super.create(); @@ -145,13 +147,14 @@ class CharSelectSubState extends MusicBeatSubState crowd.scrollFactor.set(0.3, 0.3); add(crowd); - var stageSpr:FlxSprite = new FlxSprite(-40, 391); - stageSpr.frames = Paths.getSparrowAtlas("charSelect/charSelectStage"); - stageSpr.animation.addByPrefix("idle", "stage full instance 1", 24, true); - stageSpr.animation.play("idle"); + var stageSpr:FlxAtlasSprite = new FlxAtlasSprite(-2, 1, Paths.animateAtlas("charSelect/charSelectStage")); + stageSpr.anim.play(""); + stageSpr.anim.onComplete.add(function() { + stageSpr.anim.play(""); + }); add(stageSpr); - var curtains:FlxSprite = new FlxSprite(-47, -49); + var curtains:FlxSprite = new FlxSprite(-47 - 165, -49 - 50); curtains.loadGraphic(Paths.image('charSelect/curtains')); curtains.scrollFactor.set(1.4, 1.4); add(curtains); From 9e6c17507fd75441d1b7b4f2b82ea94c05688e82 Mon Sep 17 00:00:00 2001 From: fabs Date: Mon, 9 Jun 2025 03:15:05 +0100 Subject: [PATCH 02/12] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index d861ebac0..6afc66c7b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit d861ebac027dd07d0254c79d7c89b59ee04b38f1 +Subproject commit 6afc66c7b1e08a4047523f8146acbc01844eb27d From cc9797c452ea527cedf8e634919b66765d9ed21e Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Mon, 9 Jun 2025 11:14:57 +0300 Subject: [PATCH 03/12] adjust character select for wide screen small bug, the static guy is off position sorry will fix it later i need ot go now TwT --- .../ui/charSelect/CharSelectSubState.hx | 34 ++++++++++++------- source/funkin/ui/charSelect/Nametag.hx | 2 ++ source/funkin/ui/freeplay/FreeplayState.hx | 2 +- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index dc1e835d6..2f1ec7894 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -134,12 +134,12 @@ class CharSelectSubState extends MusicBeatSubState bopInfo = FramesJSFLParser.parse(Paths.file("images/charSelect/iconBopInfo/iconBopInfo.txt")); - var bg:FlxSprite = new FlxSprite(-153, -140); + var bg:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + -153, -140); bg.loadGraphic(Paths.image('charSelect/charSelectBG')); bg.scrollFactor.set(0.1, 0.1); add(bg); - var crowd:FlxAtlasSprite = new FlxAtlasSprite(0, 0, Paths.animateAtlas("charSelect/crowd")); + var crowd:FlxAtlasSprite = new FlxAtlasSprite(FullScreenScaleMode.gameCutoutSize.x / 2, 0, Paths.animateAtlas("charSelect/crowd")); crowd.anim.play(); crowd.anim.onComplete.add(function() { crowd.anim.play(); @@ -147,14 +147,14 @@ class CharSelectSubState extends MusicBeatSubState crowd.scrollFactor.set(0.3, 0.3); add(crowd); - var stageSpr:FlxAtlasSprite = new FlxAtlasSprite(-2, 1, Paths.animateAtlas("charSelect/charSelectStage")); + var stageSpr:FlxAtlasSprite = new FlxAtlasSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + -2, 1, Paths.animateAtlas("charSelect/charSelectStage")); stageSpr.anim.play(""); stageSpr.anim.onComplete.add(function() { stageSpr.anim.play(""); }); add(stageSpr); - var curtains:FlxSprite = new FlxSprite(-47 - 165, -49 - 50); + var curtains:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + (-47 - 165), -49 - 50); curtains.loadGraphic(Paths.image('charSelect/curtains')); curtains.scrollFactor.set(1.4, 1.4); add(curtains); @@ -171,28 +171,31 @@ class CharSelectSubState extends MusicBeatSubState barthing.y += 80; FlxTween.tween(barthing, {y: barthing.y - 80}, 1.3, {ease: FlxEase.expoOut}); - var charLight:FlxSprite = new FlxSprite(800, 250); + var charLight:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 800, 250); charLight.loadGraphic(Paths.image('charSelect/charLight')); add(charLight); - var charLightGF:FlxSprite = new FlxSprite(180, 240); + var charLightGF:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 180, 240); charLightGF.loadGraphic(Paths.image('charSelect/charLight')); add(charLightGF); gfChill = new CharSelectGF(); gfChill.switchGF("bf"); + gfChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; add(gfChill); - playerChillOut = new CharSelectPlayer(0, 0); + playerChillOut = new CharSelectPlayer((FullScreenScaleMode.gameCutoutSize.x / 2), 0); playerChillOut.switchChar("bf"); + playerChillOut.x += FullScreenScaleMode.gameCutoutSize.x / 2; playerChillOut.visible = false; add(playerChillOut); playerChill = new CharSelectPlayer(0, 0); playerChill.switchChar("bf"); + playerChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; add(playerChill); - var speakers:FlxAtlasSprite = new FlxAtlasSprite(0, 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); + var speakers:FlxAtlasSprite = new FlxAtlasSprite((FullScreenScaleMode.gameCutoutSize.x / 2), 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); speakers.anim.play(""); speakers.anim.onComplete.add(function() { speakers.anim.play(""); @@ -200,19 +203,19 @@ class CharSelectSubState extends MusicBeatSubState speakers.scrollFactor.set(1.8, 1.8); add(speakers); - var fgBlur:FlxSprite = new FlxSprite(-125, 170); + var fgBlur:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + -125, 170); fgBlur.loadGraphic(Paths.image('charSelect/foregroundBlur')); fgBlur.blend = openfl.display.BlendMode.MULTIPLY; add(fgBlur); - dipshitBlur = new FlxSprite(419, -65); + dipshitBlur = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 419, -65); dipshitBlur.frames = Paths.getSparrowAtlas("charSelect/dipshitBlur"); dipshitBlur.animation.addByPrefix('idle', "CHOOSE vertical offset instance 1", 24, true); dipshitBlur.blend = BlendMode.ADD; dipshitBlur.animation.play("idle"); add(dipshitBlur); - dipshitBacking = new FlxSprite(423, -17); + dipshitBacking = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 423, -17); dipshitBacking.frames = Paths.getSparrowAtlas("charSelect/dipshitBacking"); dipshitBacking.animation.addByPrefix('idle', "CHOOSE horizontal offset instance 1", 24, true); dipshitBacking.blend = BlendMode.ADD; @@ -222,7 +225,7 @@ class CharSelectSubState extends MusicBeatSubState dipshitBacking.y += 210; FlxTween.tween(dipshitBacking, {y: dipshitBacking.y - 210}, 1.1, {ease: FlxEase.expoOut}); - chooseDipshit = new FlxSprite(426, -13); + chooseDipshit = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 426, -13); chooseDipshit.loadGraphic(Paths.image('charSelect/chooseDipshit')); add(chooseDipshit); @@ -237,6 +240,7 @@ class CharSelectSubState extends MusicBeatSubState dipshitBlur.scrollFactor.set(); nametag = new Nametag(); + nametag.midpointX += FullScreenScaleMode.gameCutoutSize.x / 2; add(nametag); nametag.scrollFactor.set(); @@ -594,6 +598,7 @@ class CharSelectSubState extends MusicBeatSubState // sync = false; playerChillOut.visible = false; playerChillOut.switchChar(char); + if (char == 'bf' || char == 'pico') playerChillOut.x += FullScreenScaleMode.gameCutoutSize.x / 2; }); #if FEATURE_NEWGROUNDS @@ -634,6 +639,7 @@ class CharSelectSubState extends MusicBeatSubState playerChill.visible = false; playerChill.switchChar(availableChars[index]); + playerChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; playerChillOut.visible = true; }); @@ -641,7 +647,7 @@ class CharSelectSubState extends MusicBeatSubState function updateIconPositions() { - grpIcons.x = 450; + grpIcons.x = (FullScreenScaleMode.gameCutoutSize.x / 2) + 450; grpIcons.y = 120; for (index => member in grpIcons.members) { @@ -1170,12 +1176,14 @@ class CharSelectSubState extends MusicBeatSubState { playerChill.visible = true; playerChill.switchChar(value); + playerChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; gfChill.switchGF(value); gfChill.visible = true; } if (frame >= index + 2) { playerChillOut.switchChar(value); + if (value == 'bf' || value == 'pico') playerChillOut.x += FullScreenScaleMode.gameCutoutSize.x / 2; playerChillOut.visible = false; playerChillOut.onAnimationFrame.removeAll(); } diff --git a/source/funkin/ui/charSelect/Nametag.hx b/source/funkin/ui/charSelect/Nametag.hx index 5bdb0e7e8..b122ffdb1 100644 --- a/source/funkin/ui/charSelect/Nametag.hx +++ b/source/funkin/ui/charSelect/Nametag.hx @@ -6,7 +6,9 @@ import flixel.util.FlxTimer; class Nametag extends FlxSprite { + @:allow(funkin.ui.charSelect.CharSelectSubState) var midpointX(default, set):Float = 1008; + @:allow(funkin.ui.charSelect.CharSelectSubState) var midpointY(default, set):Float = 100; var mosaicShader:MosaicEffect; diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index c7de5ae1d..a3b85806c 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1296,7 +1296,7 @@ class FreeplayState extends MusicBeatSubState fadeShader.fade(1.0, 0.0, 0.8, {ease: FlxEase.quadIn}); FlxG.sound.music?.fadeOut(0.9, 0); new FlxTimer().start(0.9, _ -> { - FullScreenScaleMode.enabled = false; + // FullScreenScaleMode.enabled = false; FlxG.switchState(() -> new funkin.ui.charSelect.CharSelectSubState()); }); for (grpSpr in exitMoversCharSel.keys()) From ea01052b18c247b81dd8461163ecc26b80e1a513 Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Wed, 11 Jun 2025 12:46:21 +0300 Subject: [PATCH 04/12] Fixed static guy and some resolution dependant issues --- source/funkin/ui/FullScreenScaleMode.hx | 20 +++------ .../funkin/ui/charSelect/CharSelectPlayer.hx | 16 ++++--- .../ui/charSelect/CharSelectSubState.hx | 44 +++++++++---------- source/funkin/ui/freeplay/FreeplayState.hx | 1 - 4 files changed, 37 insertions(+), 44 deletions(-) diff --git a/source/funkin/ui/FullScreenScaleMode.hx b/source/funkin/ui/FullScreenScaleMode.hx index 186485028..57587b5f5 100644 --- a/source/funkin/ui/FullScreenScaleMode.hx +++ b/source/funkin/ui/FullScreenScaleMode.hx @@ -100,6 +100,9 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode instance = this; + // Required so we can check on which axies is the game wide. + if (FlxG.stage != null) updateGameSize(FlxG.stage.stageWidth, FlxG.stage.stageHeight); + enabled = enable; } @@ -130,11 +133,8 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode if (enabled) { cutoutSize.set(ratioAxis != Y ? Width - gameSize.x : 0, ratioAxis == Y ? Height - gameSize.y : 0); - #if android - gameCutoutSize.set(ratioAxis != Y ? cutoutSize.x / 2 : 0, ratioAxis == Y ? cutoutSize.y / 2 : 0); - #else - gameCutoutSize.set(ratioAxis != Y ? cutoutSize.x : 0, ratioAxis == Y ? cutoutSize.y : 0); - #end + gameCutoutSize.copyFrom(cutoutSize); + gameCutoutSize /= gameSize.x / FlxG.initialWidth; } else { @@ -278,11 +278,8 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode final oldGameHeight = gameHeight; gameHeight = ((gameSize.x / scale.x) / maxAspectRatio.x) * maxAspectRatio.y; cutoutSize.set(0, cutoutSize.y - (oldGameHeight - gameHeight)); - #if android - gameCutoutSize.set(0, cutoutSize.y / 2); - #else gameCutoutSize.copyFrom(cutoutSize); - #end + gameCutoutSize /= gameSize.x / FlxG.initialWidth; offset.y = Math.ceil((deviceSize.y - (gameHeight * scale.y)) * 0.5); updateGamePosition(); } @@ -319,11 +316,8 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode final oldGameWidth = gameWidth; gameWidth = ((gameSize.y / scale.y) / maxAspectRatio.y) * maxAspectRatio.x; cutoutSize.set(cutoutSize.x - (oldGameWidth - gameWidth), 0); - #if android - gameCutoutSize.set(cutoutSize.x / 2, 0); - #else gameCutoutSize.copyFrom(cutoutSize); - #end + gameCutoutSize /= gameSize.x / FlxG.initialWidth; offset.x = Math.ceil((deviceSize.x - (gameWidth * scale.x)) * 0.5); updateGamePosition(); } diff --git a/source/funkin/ui/charSelect/CharSelectPlayer.hx b/source/funkin/ui/charSelect/CharSelectPlayer.hx index 23184e40d..c8daac808 100644 --- a/source/funkin/ui/charSelect/CharSelectPlayer.hx +++ b/source/funkin/ui/charSelect/CharSelectPlayer.hx @@ -6,8 +6,14 @@ import funkin.modding.events.ScriptEvent; class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass { + var initialX:Float = 0; + var initialY:Float = 0; + public function new(x:Float, y:Float) { + initialX = x; + initialY = y; + super(x, y, Paths.animateAtlas("charSelect/bfChill")); onAnimationComplete.add(function(animLabel:String) { @@ -53,13 +59,9 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass { switch (str) { - case "bf": - x = 0; - y = 0; - case "pico": - x = 0; - y = 0; - case "random": + case "bf" | 'pico' | "random": + x = initialX; + y = initialY; } } diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index 2f1ec7894..a5cee9c54 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -96,6 +96,8 @@ class CharSelectSubState extends MusicBeatSubState var charHitbox:FlxObject; + var cutoutSize:Float = 0; + public function new() { super(); @@ -132,14 +134,16 @@ class CharSelectSubState extends MusicBeatSubState { super.create(); + cutoutSize = FullScreenScaleMode.gameCutoutSize.x / 2; + bopInfo = FramesJSFLParser.parse(Paths.file("images/charSelect/iconBopInfo/iconBopInfo.txt")); - var bg:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + -153, -140); + var bg:FlxSprite = new FlxSprite(cutoutSize + -153, -140); bg.loadGraphic(Paths.image('charSelect/charSelectBG')); bg.scrollFactor.set(0.1, 0.1); add(bg); - var crowd:FlxAtlasSprite = new FlxAtlasSprite(FullScreenScaleMode.gameCutoutSize.x / 2, 0, Paths.animateAtlas("charSelect/crowd")); + var crowd:FlxAtlasSprite = new FlxAtlasSprite(cutoutSize, 0, Paths.animateAtlas("charSelect/crowd")); crowd.anim.play(); crowd.anim.onComplete.add(function() { crowd.anim.play(); @@ -147,19 +151,20 @@ class CharSelectSubState extends MusicBeatSubState crowd.scrollFactor.set(0.3, 0.3); add(crowd); - var stageSpr:FlxAtlasSprite = new FlxAtlasSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + -2, 1, Paths.animateAtlas("charSelect/charSelectStage")); + var stageSpr:FlxAtlasSprite = new FlxAtlasSprite(cutoutSize + -2, 1, Paths.animateAtlas("charSelect/charSelectStage")); stageSpr.anim.play(""); stageSpr.anim.onComplete.add(function() { stageSpr.anim.play(""); }); add(stageSpr); - var curtains:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + (-47 - 165), -49 - 50); + var curtains:FlxSprite = new FlxSprite(cutoutSize + (-47 - 165), -49 - 50); curtains.loadGraphic(Paths.image('charSelect/curtains')); curtains.scrollFactor.set(1.4, 1.4); add(curtains); barthing = new FlxAtlasSprite(0, 0, Paths.animateAtlas("charSelect/barThing")); + barthing.scale.x = 2.5; barthing.anim.play(""); barthing.anim.onComplete.add(function() { barthing.anim.play(""); @@ -171,31 +176,29 @@ class CharSelectSubState extends MusicBeatSubState barthing.y += 80; FlxTween.tween(barthing, {y: barthing.y - 80}, 1.3, {ease: FlxEase.expoOut}); - var charLight:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 800, 250); + var charLight:FlxSprite = new FlxSprite(cutoutSize + 800, 250); charLight.loadGraphic(Paths.image('charSelect/charLight')); add(charLight); - var charLightGF:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 180, 240); + var charLightGF:FlxSprite = new FlxSprite(cutoutSize + 180, 240); charLightGF.loadGraphic(Paths.image('charSelect/charLight')); add(charLightGF); gfChill = new CharSelectGF(); gfChill.switchGF("bf"); - gfChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; + gfChill.x += cutoutSize; add(gfChill); - playerChillOut = new CharSelectPlayer((FullScreenScaleMode.gameCutoutSize.x / 2), 0); + playerChillOut = new CharSelectPlayer(cutoutSize, 0); playerChillOut.switchChar("bf"); - playerChillOut.x += FullScreenScaleMode.gameCutoutSize.x / 2; playerChillOut.visible = false; add(playerChillOut); - playerChill = new CharSelectPlayer(0, 0); + playerChill = new CharSelectPlayer(cutoutSize, 0); playerChill.switchChar("bf"); - playerChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; add(playerChill); - var speakers:FlxAtlasSprite = new FlxAtlasSprite((FullScreenScaleMode.gameCutoutSize.x / 2), 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); + var speakers:FlxAtlasSprite = new FlxAtlasSprite(cutoutSize - 15, 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); speakers.anim.play(""); speakers.anim.onComplete.add(function() { speakers.anim.play(""); @@ -203,19 +206,19 @@ class CharSelectSubState extends MusicBeatSubState speakers.scrollFactor.set(1.8, 1.8); add(speakers); - var fgBlur:FlxSprite = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + -125, 170); + var fgBlur:FlxSprite = new FlxSprite(cutoutSize + -125, 170); fgBlur.loadGraphic(Paths.image('charSelect/foregroundBlur')); fgBlur.blend = openfl.display.BlendMode.MULTIPLY; add(fgBlur); - dipshitBlur = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 419, -65); + dipshitBlur = new FlxSprite(cutoutSize + 419, -65); dipshitBlur.frames = Paths.getSparrowAtlas("charSelect/dipshitBlur"); dipshitBlur.animation.addByPrefix('idle', "CHOOSE vertical offset instance 1", 24, true); dipshitBlur.blend = BlendMode.ADD; dipshitBlur.animation.play("idle"); add(dipshitBlur); - dipshitBacking = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 423, -17); + dipshitBacking = new FlxSprite(cutoutSize + 423, -17); dipshitBacking.frames = Paths.getSparrowAtlas("charSelect/dipshitBacking"); dipshitBacking.animation.addByPrefix('idle', "CHOOSE horizontal offset instance 1", 24, true); dipshitBacking.blend = BlendMode.ADD; @@ -225,7 +228,7 @@ class CharSelectSubState extends MusicBeatSubState dipshitBacking.y += 210; FlxTween.tween(dipshitBacking, {y: dipshitBacking.y - 210}, 1.1, {ease: FlxEase.expoOut}); - chooseDipshit = new FlxSprite((FullScreenScaleMode.gameCutoutSize.x / 2) + 426, -13); + chooseDipshit = new FlxSprite(cutoutSize + 426, -13); chooseDipshit.loadGraphic(Paths.image('charSelect/chooseDipshit')); add(chooseDipshit); @@ -240,7 +243,7 @@ class CharSelectSubState extends MusicBeatSubState dipshitBlur.scrollFactor.set(); nametag = new Nametag(); - nametag.midpointX += FullScreenScaleMode.gameCutoutSize.x / 2; + nametag.midpointX += cutoutSize; add(nametag); nametag.scrollFactor.set(); @@ -598,7 +601,6 @@ class CharSelectSubState extends MusicBeatSubState // sync = false; playerChillOut.visible = false; playerChillOut.switchChar(char); - if (char == 'bf' || char == 'pico') playerChillOut.x += FullScreenScaleMode.gameCutoutSize.x / 2; }); #if FEATURE_NEWGROUNDS @@ -639,7 +641,6 @@ class CharSelectSubState extends MusicBeatSubState playerChill.visible = false; playerChill.switchChar(availableChars[index]); - playerChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; playerChillOut.visible = true; }); @@ -647,7 +648,7 @@ class CharSelectSubState extends MusicBeatSubState function updateIconPositions() { - grpIcons.x = (FullScreenScaleMode.gameCutoutSize.x / 2) + 450; + grpIcons.x = cutoutSize + 450; grpIcons.y = 120; for (index => member in grpIcons.members) { @@ -728,7 +729,6 @@ class CharSelectSubState extends MusicBeatSubState { ease: FlxEase.backIn, onComplete: function(_) { - funkin.ui.FullScreenScaleMode.enabled = true; FlxG.switchState(() -> FreeplayState.build( { { @@ -1176,14 +1176,12 @@ class CharSelectSubState extends MusicBeatSubState { playerChill.visible = true; playerChill.switchChar(value); - playerChill.x += FullScreenScaleMode.gameCutoutSize.x / 2; gfChill.switchGF(value); gfChill.visible = true; } if (frame >= index + 2) { playerChillOut.switchChar(value); - if (value == 'bf' || value == 'pico') playerChillOut.x += FullScreenScaleMode.gameCutoutSize.x / 2; playerChillOut.visible = false; playerChillOut.onAnimationFrame.removeAll(); } diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index a3b85806c..3cbf35a13 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1296,7 +1296,6 @@ class FreeplayState extends MusicBeatSubState fadeShader.fade(1.0, 0.0, 0.8, {ease: FlxEase.quadIn}); FlxG.sound.music?.fadeOut(0.9, 0); new FlxTimer().start(0.9, _ -> { - // FullScreenScaleMode.enabled = false; FlxG.switchState(() -> new funkin.ui.charSelect.CharSelectSubState()); }); for (grpSpr in exitMoversCharSel.keys()) From d79f99475e1d9a328c50fdde785cb43a89124364 Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:31:46 +0700 Subject: [PATCH 05/12] Remove swipe right to exit on Freeplay --- source/funkin/ui/freeplay/FreeplayState.hx | 45 +++++++++++----------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 6c89a6dd0..b15fa9771 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1883,30 +1883,31 @@ class FreeplayState extends MusicBeatSubState { if (fnfFreeplay == null || freeplayTxtBg == null || freeplayArrow == null) return; - if (TouchUtil.justPressed && (TouchUtil.overlaps(fnfFreeplay) || TouchUtil.overlaps(freeplayTxtBg))) - { - _dragOffset = fnfFreeplay.x - TouchUtil.touch.x; - _pressedOnFreeplay = true; - } + // Commenting this out for now, since it doesn't work properly with the new touch controls. - Zack + // if (TouchUtil.justPressed && (TouchUtil.overlaps(fnfFreeplay) || TouchUtil.overlaps(freeplayTxtBg))) + // { + // _dragOffset = fnfFreeplay.x - TouchUtil.touch.x; + // _pressedOnFreeplay = true; + // } - if (_pressedOnFreeplay && TouchUtil.pressed) - { - final dragX:Float = TouchUtil.touch.x + _dragOffset; - fnfFreeplay.x = dragX; - freeplayTxtBg.x = dragX - 8; + // if (_pressedOnFreeplay && TouchUtil.pressed) + // { + // final dragX:Float = TouchUtil.touch.x + _dragOffset; + // fnfFreeplay.x = dragX; + // freeplayTxtBg.x = dragX - 8; - if (diffSelRight != null && freeplayArrow.x + 160 < fnfFreeplay.x) - { - _pressedOnFreeplay = false; - goBack(); - } - } - else - { - fnfFreeplay.x = Math.max(FullScreenScaleMode.gameNotchSize.x, 8); - freeplayTxtBg.x = FullScreenScaleMode.gameNotchSize.x; - _pressedOnFreeplay = false; - } + // if (diffSelRight != null && freeplayArrow.x + 160 < fnfFreeplay.x) + // { + // _pressedOnFreeplay = false; + // goBack(); + // } + // } + // else + // { + fnfFreeplay.x = Math.max(FullScreenScaleMode.gameNotchSize.x, 8); + freeplayTxtBg.x = FullScreenScaleMode.gameNotchSize.x; + _pressedOnFreeplay = false; + // } } #end From 738bd8b7c7b1638c776bd012eb64cedf31bf48bd Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:32:15 +0700 Subject: [PATCH 06/12] Increase arrows touch hitbox for Freeplay --- source/funkin/ui/freeplay/FreeplayState.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index b15fa9771..eed78cec0 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -2785,6 +2785,13 @@ class DifficultySelector extends FlxSprite pressed = press; } + + override function updateHitbox() + { + super.updateHitbox(); + width *= 1.5; + height *= 1.5; + } #end function moveShitDown():Void From 6b11f8b852392f5f8b7922831dc3db5ada5c1ce7 Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Thu, 12 Jun 2025 23:45:50 +0300 Subject: [PATCH 07/12] slight refactor for `FullScreenScaleMode` to fix some wide screen related issue --- .../mobile/ui/options/ControlsSchemeMenu.hx | 2 +- .../play/cutscene/dialogue/DialogueBox.hx | 8 +- .../funkin/play/cutscene/dialogue/Speaker.hx | 6 +- source/funkin/ui/FullScreenScaleMode.hx | 164 ++++++++++-------- .../ui/charSelect/CharSelectSubState.hx | 6 +- source/funkin/ui/freeplay/FreeplayState.hx | 2 +- source/funkin/ui/freeplay/SongMenuItem.hx | 2 +- 7 files changed, 107 insertions(+), 83 deletions(-) diff --git a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx index 2044980fa..34ba6dd01 100644 --- a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx +++ b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx @@ -166,7 +166,7 @@ class ControlsSchemeMenu extends MusicBeatSubState for (i in 0...availableSchemes.length) { final hitboxShowcase:HitboxShowcase = new HitboxShowcase(0, 0, i, currentIndex, availableSchemes[i], onSelectHitbox); - hitboxShowcase.x = Math.floor(FlxG.width * -0.16 + (1500 * (i * FullScreenScaleMode.windowScale.x))); + hitboxShowcase.x = Math.floor(FlxG.width * -0.16 + (1500 * (i * FullScreenScaleMode.wideScale.x))); hitboxShowcases.add(hitboxShowcase); } diff --git a/source/funkin/play/cutscene/dialogue/DialogueBox.hx b/source/funkin/play/cutscene/dialogue/DialogueBox.hx index 90d4d6a22..99f3b3717 100644 --- a/source/funkin/play/cutscene/dialogue/DialogueBox.hx +++ b/source/funkin/play/cutscene/dialogue/DialogueBox.hx @@ -64,7 +64,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple this.x += xDiff; this.y += yDiff; - if (FullScreenScaleMode.windowScale.x != 1) + if (FullScreenScaleMode.wideScale.x != 1) { this.x *= fullscreenScale; this.y = this.y * fullscreenScale + (-100 * fullscreenScale); @@ -104,7 +104,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple function get_fullscreenScale():Float { - return FullScreenScaleMode.windowScale.x - 0.05; + return FullScreenScaleMode.wideScale.x - 0.05; } public function new(id:String) @@ -208,7 +208,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple { if (scale == null) scale = 1.0; - if (FullScreenScaleMode.windowScale.x != 1) + if (FullScreenScaleMode.wideScale.x != 1) { scale *= fullscreenScale; } @@ -310,7 +310,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple textDisplay.x += _data.text.offsets[0]; textDisplay.y += _data.text.offsets[1]; - if (FullScreenScaleMode.windowScale.x != 1) + if (FullScreenScaleMode.wideScale.x != 1) { textDisplay.fieldWidth *= fullscreenScale; textDisplay.x *= fullscreenScale; diff --git a/source/funkin/play/cutscene/dialogue/Speaker.hx b/source/funkin/play/cutscene/dialogue/Speaker.hx index d47914fce..21ea23f8f 100644 --- a/source/funkin/play/cutscene/dialogue/Speaker.hx +++ b/source/funkin/play/cutscene/dialogue/Speaker.hx @@ -67,7 +67,7 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe this.x += xDiff; this.y += yDiff; - if (FullScreenScaleMode.windowScale.x != 1) + if (FullScreenScaleMode.wideScale.x != 1) { this.x *= fullscreenScale; this.y = this.y * fullscreenScale + (-100 * fullscreenScale); @@ -83,7 +83,7 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe function get_fullscreenScale():Float { - return FullScreenScaleMode.windowScale.x - 0.05; + return FullScreenScaleMode.wideScale.x - 0.05; } public function new(id:String) @@ -170,7 +170,7 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe { if (scale == null) scale = 1.0; - if (FullScreenScaleMode.windowScale.x != 1) + if (FullScreenScaleMode.wideScale.x != 1) { scale *= fullscreenScale; } diff --git a/source/funkin/ui/FullScreenScaleMode.hx b/source/funkin/ui/FullScreenScaleMode.hx index 57587b5f5..632fbd5cf 100644 --- a/source/funkin/ui/FullScreenScaleMode.hx +++ b/source/funkin/ui/FullScreenScaleMode.hx @@ -59,12 +59,12 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode /** * The aspect ratio of the window. */ - public static var windowRatio:Float = -1; + public static var screenRatio:Float = -1; /** * The scale factor for the window. */ - public static var windowScale:FlxPoint = FlxPoint.get(1, 1); + public static var wideScale:FlxPoint = FlxPoint.get(1, 1); /** * Axis used to determine the ratio (X or Y). @@ -125,22 +125,7 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode updateScaleOffset(); updateGamePosition(); - adjustWindowScale(); - } - - private function updateDeviceCutout(Width:Int, Height:Int):Void - { - if (enabled) - { - cutoutSize.set(ratioAxis != Y ? Width - gameSize.x : 0, ratioAxis == Y ? Height - gameSize.y : 0); - gameCutoutSize.copyFrom(cutoutSize); - gameCutoutSize /= gameSize.x / FlxG.initialWidth; - } - else - { - cutoutSize.set(0, 0); - gameCutoutSize.set(0, 0); - } + adjustGameSize(); } /** @@ -234,124 +219,161 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode hasFakeCutouts = false; } + private function updateDeviceCutout(Width:Int, Height:Int):Void + { + if (enabled) + { + cutoutSize.x = ratioAxis == X ? Math.ceil(Width - (Height * (FlxG.width / FlxG.height))) : 0; + cutoutSize.y = ratioAxis == Y ? Math.ceil(Height - (Width / (FlxG.width / FlxG.height))) : 0; + gameCutoutSize.copyFrom(cutoutSize); + gameCutoutSize /= gameSize.x / FlxG.initialWidth; + } + else + { + cutoutSize.set(0, 0); + gameCutoutSize.set(0, 0); + } + } + + override public function updateGameSize(Width:Int, Height:Int):Void + { + gameRatio = FlxG.width / FlxG.height; + screenRatio = Width / Height; + ratioAxis = screenRatio < gameRatio ? FlxAxes.Y : FlxAxes.X; + + if (ratioAxis == FlxAxes.Y) + { + gameSize.x = Width; + gameSize.y = enabled ? Height : Math.ceil(gameSize.x / gameRatio); + } + else + { + gameSize.y = Height; + gameSize.x = enabled ? Width : Math.ceil(gameSize.y * gameRatio); + } + } + + override public function updateScaleOffset():Void + { + scale.x = ratioAxis == X ? Math.ceil(deviceSize.y * (FlxG.width / FlxG.height)) / FlxG.width : deviceSize.x / FlxG.width; + scale.y = ratioAxis == Y ? Math.ceil(deviceSize.x / (FlxG.width / FlxG.height)) / FlxG.height : deviceSize.y / FlxG.height; + updateOffsetX(); + updateOffsetY(); + } + #if mobile private function updateDeviceNotch(notch:lime.math.Rectangle):Void { notchPosition.set(enabled ? notch.x : 0, enabled ? notch.y : 0); notchSize.set(enabled ? notch.width : 0, enabled ? notch.height : 0); - gameNotchPosition.set((notchPosition.x * scale.x) / 2, (notchPosition.y * scale.y) / 2); - gameNotchSize.set((notchSize.x * scale.x) / 2, (notchSize.y * scale.y) / 2); + gameNotchPosition.copyFrom(notchPosition); + gameNotchSize.copyFrom(notchSize); + + final scale:Float = gameSize.x / FlxG.initialWidth; + gameNotchPosition /= scale; + gameNotchSize /= scale; } #end - private function adjustWindowScale():Void + public function reset():Void + { + cutoutSize.set(0, 0); + gameCutoutSize.set(0, 0); + notchSize.set(0, 0); + gameNotchSize.set(0, 0); + notchPosition.set(0, 0); + gameNotchPosition.set(0, 0); + } + + private function adjustGameSize():Void { if ((cutoutSize.x > 0 || cutoutSize.y > 0) && enabled) { - windowScale.set(1, 1); + wideScale.set(1, 1); if (ratioAxis == Y) { - gameSize.y += cutoutSize.y; - var gameHeight:Float = gameSize.y / scale.y; #if desktop if (MathUtil.gcd(FlxG.width, Math.ceil(gameHeight)) == 1) { gameSize.y -= cutoutSize.y; - cutoutSize.set(0, 0); - gameCutoutSize.set(0, 0); - notchSize.set(0, 0); - gameNotchSize.set(0, 0); - notchPosition.set(0, 0); - gameNotchPosition.set(0, 0); - offset.y = Math.ceil((deviceSize.y - gameSize.y) * 0.5); updateGamePosition(); + reset(); return; } #end if (gameHeight / FlxG.width > maxAspectRatio.y / maxAspectRatio.x && maxRatioAxis.y) { - final oldGameHeight = gameHeight; + final oldGameHeight = gameSize.y; gameHeight = ((gameSize.x / scale.x) / maxAspectRatio.x) * maxAspectRatio.y; + gameSize.y = gameHeight * scale.y; + cutoutSize.set(0, cutoutSize.y - (oldGameHeight - gameHeight)); gameCutoutSize.copyFrom(cutoutSize); gameCutoutSize /= gameSize.x / FlxG.initialWidth; - offset.y = Math.ceil((deviceSize.y - (gameHeight * scale.y)) * 0.5); + + final sizeDifference:Float = oldGameHeight - gameSize.y; + final scale:Float = gameSize.y / FlxG.initialHeight; + cutoutSize.set(0, cutoutSize.y - sizeDifference); + gameCutoutSize.copyFrom(cutoutSize); + gameCutoutSize /= scale; + + notchSize.y = Math.max(0, notchSize.y - sizeDifference); + gameNotchSize.y = notchSize.y / scale; + + offset.y = Math.ceil((deviceSize.y - gameSize.y) * 0.5); updateGamePosition(); } untyped FlxG.height = Math.ceil(gameHeight); - windowScale.y = FlxG.height / FlxG.initialHeight; + wideScale.y = FlxG.height / FlxG.initialHeight; } else { - gameSize.x += cutoutSize.x; - var gameWidth:Float = gameSize.x / scale.x; #if desktop if (MathUtil.gcd(Math.ceil(gameWidth), FlxG.height) == 1) { gameSize.x -= cutoutSize.x; - cutoutSize.set(0, 0); - gameCutoutSize.set(0, 0); - notchSize.set(0, 0); - gameNotchSize.set(0, 0); - notchPosition.set(0, 0); - gameNotchPosition.set(0, 0); - offset.x = Math.ceil((deviceSize.x - gameSize.x) * 0.5); updateGamePosition(); + reset(); return; } #end if (gameWidth / FlxG.height > maxAspectRatio.x / maxAspectRatio.y && maxRatioAxis.x) { - final oldGameWidth = gameWidth; + final oldGameWidth = gameSize.x; gameWidth = ((gameSize.y / scale.y) / maxAspectRatio.y) * maxAspectRatio.x; - cutoutSize.set(cutoutSize.x - (oldGameWidth - gameWidth), 0); + gameSize.x = gameWidth * scale.x; + + final sizeDifference:Float = oldGameWidth - gameSize.x; + final scale:Float = gameSize.x / FlxG.initialWidth; + cutoutSize.set(cutoutSize.x - sizeDifference, 0); gameCutoutSize.copyFrom(cutoutSize); - gameCutoutSize /= gameSize.x / FlxG.initialWidth; - offset.x = Math.ceil((deviceSize.x - (gameWidth * scale.x)) * 0.5); + gameCutoutSize /= scale; + + notchSize.x = Math.max(0, notchSize.x - sizeDifference); + gameNotchSize.x = notchSize.x / scale; + + offset.x = Math.ceil((deviceSize.x - gameSize.x) * 0.5); updateGamePosition(); } untyped FlxG.width = Math.ceil(gameWidth); - windowScale.x = FlxG.width / FlxG.initialWidth; + wideScale.x = FlxG.width / FlxG.initialWidth; } } } - /** - * Updates the game size based on the provided width and height. - * @param Width The width of the screen. - * @param Height The height of the screen. - */ - override public function updateGameSize(Width:Int, Height:Int):Void - { - gameRatio = FlxG.width / FlxG.height; - windowRatio = Width / Height; - ratioAxis = windowRatio < gameRatio ? FlxAxes.Y : FlxAxes.X; - - if (ratioAxis == FlxAxes.Y) - { - gameSize.x = Width; - gameSize.y = Math.ceil(gameSize.x / gameRatio); - } - else - { - gameSize.y = Height; - gameSize.x = Math.ceil(gameSize.y * gameRatio); - } - } - @:noCompletion private static function set_enabled(Value:Bool):Bool { diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index a5cee9c54..41ea285d3 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -135,6 +135,7 @@ class CharSelectSubState extends MusicBeatSubState super.create(); cutoutSize = FullScreenScaleMode.gameCutoutSize.x / 2; + cutoutSize *= FullScreenScaleMode.wideScale.x; bopInfo = FramesJSFLParser.parse(Paths.file("images/charSelect/iconBopInfo/iconBopInfo.txt")); @@ -164,12 +165,12 @@ class CharSelectSubState extends MusicBeatSubState add(curtains); barthing = new FlxAtlasSprite(0, 0, Paths.animateAtlas("charSelect/barThing")); - barthing.scale.x = 2.5; barthing.anim.play(""); barthing.anim.onComplete.add(function() { barthing.anim.play(""); }); barthing.blend = BlendMode.MULTIPLY; + barthing.scale.x = 2.5; barthing.scrollFactor.set(0, 0); add(barthing); @@ -198,12 +199,13 @@ class CharSelectSubState extends MusicBeatSubState playerChill.switchChar("bf"); add(playerChill); - var speakers:FlxAtlasSprite = new FlxAtlasSprite(cutoutSize - 15, 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); + var speakers:FlxAtlasSprite = new FlxAtlasSprite(cutoutSize, 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); speakers.anim.play(""); speakers.anim.onComplete.add(function() { speakers.anim.play(""); }); speakers.scrollFactor.set(1.8, 1.8); + speakers.scale.set(1.12, 1.12); add(speakers); var fgBlur:FlxSprite = new FlxSprite(cutoutSize + -125, 170); diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 3cbf35a13..13628c738 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -746,7 +746,7 @@ class FreeplayState extends MusicBeatSubState funnyCam.bgColor = FlxColor.TRANSPARENT; FlxG.cameras.add(funnyCam, false); - rankVignette.scale.set(2 * FullScreenScaleMode.windowScale.x, 2 * FullScreenScaleMode.windowScale.y); + rankVignette.scale.set(2 * FullScreenScaleMode.wideScale.x, 2 * FullScreenScaleMode.wideScale.y); rankVignette.updateHitbox(); rankVignette.blend = BlendMode.ADD; // rankVignette.cameras = [rankCamera]; diff --git a/source/funkin/ui/freeplay/SongMenuItem.hx b/source/funkin/ui/freeplay/SongMenuItem.hx index 23376623c..887a4b3c4 100644 --- a/source/funkin/ui/freeplay/SongMenuItem.hx +++ b/source/funkin/ui/freeplay/SongMenuItem.hx @@ -624,7 +624,7 @@ class SongMenuItem extends FlxSpriteGroup capsule.scale.y *= realScaled; frameInTypeBeat += 1; - final shiftx:Float = FullScreenScaleMode.windowScale.x * 320; + final shiftx:Float = FullScreenScaleMode.wideScale.x * 320; final widescreenMult:Float = (FullScreenScaleMode.gameCutoutSize.x / 1.5) * 0.75; // Move the targetPos set to the if statement below if you want them to shift to their target positions after jumping in instead // I have no idea why this if instead of frameInTypeBeat == xFrames.length works even though they're the same thing From dc800dc48ef2a43cedc58d1121c48dc3e98627e3 Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Fri, 13 Jun 2025 00:32:09 +0300 Subject: [PATCH 08/12] added `logicalSize` to `FullScreenScaleMode` --- source/funkin/ui/FullScreenScaleMode.hx | 34 +++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/source/funkin/ui/FullScreenScaleMode.hx b/source/funkin/ui/FullScreenScaleMode.hx index 632fbd5cf..8ff8e0d18 100644 --- a/source/funkin/ui/FullScreenScaleMode.hx +++ b/source/funkin/ui/FullScreenScaleMode.hx @@ -26,6 +26,12 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode */ public static var notchSize:FlxPoint = FlxPoint.get(0, 0); + /** + * The size of the game in screen resolution relativly to the initial size. + * eg: If screen is 1080p and initial size of the game is 1280x720 then this is 1920x1080. + */ + public static var logicalSize:FlxPoint = FlxPoint.get(0, 0); + /** * The maximum aspect ratio a screen can have. */ @@ -223,10 +229,10 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode { if (enabled) { - cutoutSize.x = ratioAxis == X ? Math.ceil(Width - (Height * (FlxG.width / FlxG.height))) : 0; - cutoutSize.y = ratioAxis == Y ? Math.ceil(Height - (Width / (FlxG.width / FlxG.height))) : 0; + cutoutSize.x = ratioAxis == X ? Math.ceil(Width - logicalSize.x) : 0; + cutoutSize.y = ratioAxis == Y ? Math.ceil(Height - logicalSize.y) : 0; gameCutoutSize.copyFrom(cutoutSize); - gameCutoutSize /= gameSize.x / FlxG.initialWidth; + gameCutoutSize /= logicalSize.x / FlxG.initialWidth; } else { @@ -241,22 +247,26 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode screenRatio = Width / Height; ratioAxis = screenRatio < gameRatio ? FlxAxes.Y : FlxAxes.X; + logicalSize.set(Width, Height); + if (ratioAxis == FlxAxes.Y) { gameSize.x = Width; - gameSize.y = enabled ? Height : Math.ceil(gameSize.x / gameRatio); + logicalSize.y = Math.ceil(gameSize.x / gameRatio); + gameSize.y = enabled ? Height : logicalSize.y; } else { gameSize.y = Height; - gameSize.x = enabled ? Width : Math.ceil(gameSize.y * gameRatio); + logicalSize.x = Math.ceil(gameSize.y * gameRatio); + gameSize.x = enabled ? Width : logicalSize.x; } } override public function updateScaleOffset():Void { - scale.x = ratioAxis == X ? Math.ceil(deviceSize.y * (FlxG.width / FlxG.height)) / FlxG.width : deviceSize.x / FlxG.width; - scale.y = ratioAxis == Y ? Math.ceil(deviceSize.x / (FlxG.width / FlxG.height)) / FlxG.height : deviceSize.y / FlxG.height; + scale.x = ratioAxis == X ? logicalSize.x / FlxG.width : deviceSize.x / FlxG.width; + scale.y = ratioAxis == Y ? logicalSize.y / FlxG.height : deviceSize.y / FlxG.height; updateOffsetX(); updateOffsetY(); } @@ -269,7 +279,7 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode gameNotchPosition.copyFrom(notchPosition); gameNotchSize.copyFrom(notchSize); - final scale:Float = gameSize.x / FlxG.initialWidth; + final scale:Float = logicalSize.x / FlxG.initialWidth; gameNotchPosition /= scale; gameNotchSize /= scale; } @@ -312,12 +322,8 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode gameHeight = ((gameSize.x / scale.x) / maxAspectRatio.x) * maxAspectRatio.y; gameSize.y = gameHeight * scale.y; - cutoutSize.set(0, cutoutSize.y - (oldGameHeight - gameHeight)); - gameCutoutSize.copyFrom(cutoutSize); - gameCutoutSize /= gameSize.x / FlxG.initialWidth; - final sizeDifference:Float = oldGameHeight - gameSize.y; - final scale:Float = gameSize.y / FlxG.initialHeight; + final scale:Float = logicalSize.y / FlxG.initialHeight; cutoutSize.set(0, cutoutSize.y - sizeDifference); gameCutoutSize.copyFrom(cutoutSize); gameCutoutSize /= scale; @@ -355,7 +361,7 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode gameSize.x = gameWidth * scale.x; final sizeDifference:Float = oldGameWidth - gameSize.x; - final scale:Float = gameSize.x / FlxG.initialWidth; + final scale:Float = logicalSize.x / FlxG.initialWidth; cutoutSize.set(cutoutSize.x - sizeDifference, 0); gameCutoutSize.copyFrom(cutoutSize); gameCutoutSize /= scale; From b75cfcb83333a2b663ac092d9930d521ea0e927b Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Fri, 13 Jun 2025 01:18:22 +0300 Subject: [PATCH 09/12] Fixed last few issues with ios for notch and centering on character select --- source/funkin/ui/FullScreenScaleMode.hx | 17 +++++++++++++++-- .../funkin/ui/charSelect/CharSelectSubState.hx | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/FullScreenScaleMode.hx b/source/funkin/ui/FullScreenScaleMode.hx index 8ff8e0d18..67b4e5a02 100644 --- a/source/funkin/ui/FullScreenScaleMode.hx +++ b/source/funkin/ui/FullScreenScaleMode.hx @@ -280,8 +280,21 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode gameNotchSize.copyFrom(notchSize); final scale:Float = logicalSize.x / FlxG.initialWidth; - gameNotchPosition /= scale; - gameNotchSize /= scale; + if (logicalSize > FlxG.initialWidth) + { + gameNotchPosition /= scale; + gameNotchSize /= scale; + } + else + { + gameNotchPosition *= scale; + gameNotchSize *= scale; + } + + #if ios + gameNotchPosition /= 2; + gameNotchSize /= 2; + #end } #end diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index 41ea285d3..8e284feb0 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -135,7 +135,9 @@ class CharSelectSubState extends MusicBeatSubState super.create(); cutoutSize = FullScreenScaleMode.gameCutoutSize.x / 2; + #if !ios cutoutSize *= FullScreenScaleMode.wideScale.x; + #end bopInfo = FramesJSFLParser.parse(Paths.file("images/charSelect/iconBopInfo/iconBopInfo.txt")); From 603e370908fe250d1b5edfbcde8fa7a8488af6a6 Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Fri, 13 Jun 2025 01:29:26 +0300 Subject: [PATCH 10/12] assets submodule !! --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 6afc66c7b..66747f3d1 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 6afc66c7b1e08a4047523f8146acbc01844eb27d +Subproject commit 66747f3d1a6d2bca1fb74540c2f1793602d43d2f From ffbc8c80c843964e2a27cf863c93872802cf736a Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Fri, 13 Jun 2025 02:42:05 +0300 Subject: [PATCH 11/12] nudge the speakers a bit to cover the curtain properly --- source/funkin/ui/FullScreenScaleMode.hx | 2 +- source/funkin/ui/charSelect/CharSelectSubState.hx | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/source/funkin/ui/FullScreenScaleMode.hx b/source/funkin/ui/FullScreenScaleMode.hx index 67b4e5a02..6d82a8a3d 100644 --- a/source/funkin/ui/FullScreenScaleMode.hx +++ b/source/funkin/ui/FullScreenScaleMode.hx @@ -280,7 +280,7 @@ class FullScreenScaleMode extends flixel.system.scaleModes.BaseScaleMode gameNotchSize.copyFrom(notchSize); final scale:Float = logicalSize.x / FlxG.initialWidth; - if (logicalSize > FlxG.initialWidth) + if (Math.ceil(logicalSize.x) > FlxG.initialWidth) { gameNotchPosition /= scale; gameNotchSize /= scale; diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index 8e284feb0..dc767d6d8 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -128,16 +128,11 @@ class CharSelectSubState extends MusicBeatSubState var fadeShader:BlueFade = new BlueFade(); - var speakers2:FlxAtlasSprite; - override public function create():Void { super.create(); cutoutSize = FullScreenScaleMode.gameCutoutSize.x / 2; - #if !ios - cutoutSize *= FullScreenScaleMode.wideScale.x; - #end bopInfo = FramesJSFLParser.parse(Paths.file("images/charSelect/iconBopInfo/iconBopInfo.txt")); @@ -201,13 +196,13 @@ class CharSelectSubState extends MusicBeatSubState playerChill.switchChar("bf"); add(playerChill); - var speakers:FlxAtlasSprite = new FlxAtlasSprite(cutoutSize, 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); + var speakers:FlxAtlasSprite = new FlxAtlasSprite(cutoutSize - 10, 0, Paths.animateAtlas("charSelect/charSelectSpeakers")); speakers.anim.play(""); speakers.anim.onComplete.add(function() { speakers.anim.play(""); }); speakers.scrollFactor.set(1.8, 1.8); - speakers.scale.set(1.12, 1.12); + speakers.scale.set(1.05, 1.05); add(speakers); var fgBlur:FlxSprite = new FlxSprite(cutoutSize + -125, 170); From 48ca0ecef362eda9f9f68ee5d3e231fa478863fd Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Fri, 13 Jun 2025 02:48:29 +0300 Subject: [PATCH 12/12] Update art --- art | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/art b/art index 5b5a20778..01d9d25f8 160000 --- a/art +++ b/art @@ -1 +1 @@ -Subproject commit 5b5a207789d1b73af467fca7ad17307c3e4c67c9 +Subproject commit 01d9d25f892f2e11c6e4a04087a6b444b17a6d2c